use 5.010; use autodie qw(:all); for my $file (@ARGV) { say "Now processing file '$file'"; open my $handle, '<:raw', $file; while (my $line = readline $handle) { # do something with the line here. } close $handle; }