#!/usr/bin/perl
        
use strict;
use warnings;

my @x = (0,1); #pretend we had 0 and 1 already
print "@x ";  #first fibonacci numbers are 0 1, print them

for (my $counter = 1;$counter < 19;$counter++) { #do 18 more,  
    # already did 2
    my $newVal = $x[-1] + $x[-2]; #negative index into array 
            # starts from the end so get the last two 
            # numbers and sum them for the new one 
    print "$newVal "; #print it and a space
    push(@x,$newVal); #and push it onto the end of the list
}
print "\n"; #and end with a newline
