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,
  • Comment on Re^2: Using glob in file test gives "Use of uninitialized value in -e" warning.
  • Download Code

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". ;-)