in reply to Re^2: how to deal with incorrect command line argument
in thread how to deal with incorrect command line argument

You're most welcome! Am glad it helped.

You're commenting is correct. You asked, "why use $_ here?" Because Perls default scalar ($_) is implicitly used in the for loop that's iterating through the elements of @ARGV. Note, also, that Perl's default scalar is also implicitly used in the expression if (-e) { as that expression is equivalent to if (-e $_) {.

The purpose of next is to get the next element of @ARGV, otherwise a warn would occur.