in reply to comparing multiple arg values against multiple files

You might consider a recursive function if you'd like to look ahead to when you need to check four, or four hundred, files...

Or a while loop might be just what you want (and without the overhead of a function).

my $command = pop @ARRAY; while (shift @ARRAY) { die ("Error: " . $!) unless -e; } # run your command here -- exec $command, I assume

This does take a performance hit because of the shift, so if speed is paramount you could just as easily use a for{} loop.

Hope that answers the question.