Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

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

by choroba (Cardinal)
on Dec 07, 2017 at 13:20 UTC ( [id://1205092]=note: print w/replies, xml ) Need Help??


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

What glob returns depends on the context. In scalar context (which -e imposes) it iterates over the matching files, and returns undef when there are no more files. If nothing matches the glob, it returns undef directly.

($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

Replies are listed 'Best First'.
Re^3: Using glob in file test gives "Use of uninitialized value in -e" warning.
by afoken (Chancellor) on Dec 07, 2017 at 20:42 UTC
    What glob returns depends on the context.

    I must admit I never even thought of using glob in a non-list context, so I learned something new today. Great!

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Log In?
Username:
Password:

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

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

    No recent polls found