perl -Mstrictures -e'while(<>){1;}continue{print "$ARGV\n" if eof;}; print $!' file1 file2 file3 file1 Can't open file2: No such file or directory at -e line 1, <> line 1.