sub test{ my @array; my $i; # code # noch mehr code @array = (1..20); for $i ( @array ){ print $i; } }