while (my $file = shift @ARGV) { next unless -r $file; # Process the file here }