Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Using glob in file test gives "Use of uninitialized value in -e" warning.

by toolic (Bishop)
on Dec 06, 2017 at 21:29 UTC ( [id://1205054]=note: print w/replies, xml ) Need Help??


in reply to [SOLVED]: Using glob in file test gives "Use of uninitialized value in -e" warning.

When I enable warnings on the command line, I get warnings :)
perl -wle 'print -e glob "/abc/def/ghi/test*"' Use of uninitialized value in -e at -e line 1. Use of uninitialized value in print at -e line 1.

Here is one way to do what you want:

if (glob '/abc/def/ghi/test*') { # sudo }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1205054]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2024-03-19 03:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found