Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^4: Using grep and glob to find directories containing file

by Anonymous Monk
on Feb 03, 2013 at 16:47 UTC ( #1016837=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Using grep and glob to find directories containing file
in thread Using grep and glob to find directories containing file

Thanks for the help and explanation!!!

This behavior is certainly not obvious and it is not (clearly) documented either under 'perldoc -f glob' or at perldoc.perl.org. The line saying "In scalar context, glob iterates through such filename expansions, returning undef when the list is exhausted" does not make it clear (at least to me) that such a state persists across calls to glob with a new argument! In fact, I can imagine all types of unintended errors when glob has been called in a scalar context in one place and then many lines later is called again in a different context and the programmer would have no idea that the state persists.

But then again I am not a Perl monk so these things are never obvious to me :)


Comment on Re^4: Using grep and glob to find directories containing file

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2014-10-02 09:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (52 votes), past polls