$ perl -we ' my @array = qw( file1 file2 file3 ); foreach my $i (@array) { print "\$i = $i\n" }' $i = file1 $i = file2 $i = file3