In other languages I\'ve used like Erlang and Python, if I am splitting a string and don\'t care about one of the fields, I can use an underscore placeholder. I tried this
And just to explain why you get the particular error that you see...
_ is a internal Perl variable that can be used in the stat command to indicate "the same file as we used in the previous stat call". That way Perl uses a cached stat data structure and doesn't make another stat call.
if (-x $file and -r _) { ... }
This filehandle is a constant value and can't be written to. The variable is stored in the same typeglob as $_ and @_.
See perldoc stat.