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

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

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

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

Thanks 7stud for all your patience and persistence in helping me figure out this strange/unexpected behavior.

It seems to me that this is a hidden and potentially significant time-bomb type issue since glob is a core function and it's not inconceivable that people will bury it somewhere in a module where it is used in static context. Then it will lay there waiting until one day someone calls the module from a loop and gets wrong results.

This would be bad enough if the behavior were fully or even adequately documented. But currently, the documentation at best alludes rather obscurely to the behavior that can lead to an issue in such a context.

Do people agree this is a valid issue that needs addressing either in 'fixing' glob or at least in documenting and warning about the behavior?

If so how does one properly report such an issue?
  • Comment on Re^2: Using grep and glob to find directories containing file

Replies are listed 'Best First'.
Re^3: Using grep and glob to find directories containing file
by Corion (Pope) on Feb 04, 2013 at 16:49 UTC

    I think the problem is most similar to the problem of keys (not) resetting the iterator over a hash. I guess that the best solution is to not call glob in scalar context at all.

    Most likely, part of the documentation of keys can be adapted to be added to the glob documentation. I would open a bug report using the perlbug utility, best together with a proposed documentation patch that cautions against using glob in scalar context.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1016976]
[Your Mother]: Hey, let's not bring antisemitism into the conversation.
[LanX]: for centuries posh English speakers tried to approach French, that's where all the trouble starts
[Eily]: Just another Perl coeurs
[Eily]: (perl with hearts, 'Acker with a French accent is pronunced like coeurs)
[LanX]: IMHO 'ju' for 'u' happens in English where they can't pronounce the French u (or German )
[LanX]: and I'm sure I read that *hotel* used to be pronounced 'otel by the English upperclass
[Your Mother]: American English vowels are pretty lazy/mumbly in general.
[LanX]: talking about antisemitism, youtube automatic subtitles is entertaining shocking sometimes ... like when offering "Fruit Jews" as a drink
[Your Mother]: ...Come on you King of the Juice...
[Your Mother]: I actually know his kids.

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (10)
As of 2017-03-27 17:15 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (320 votes). Check out past polls.