die "File $_ does not exist" for grep { not -e } @ARGV; # make sure @ARGV only contains filenames. warn '@ARGV is empty, the program will read from STDIN' unless @ARGV;