my @f=(); my $t=0; my $i=0; while($i!=10;$_){ if($i<2){@f($i)=1} else{ @f($i)=@f($i-2)+@f($i-1); } print "$i --> @f($i) \n"; print "@f[5]\n"; $i++; }