foreach my $line (@ARGV) { print "$line\n"; # or do anything else with it }