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

Re^2: a glob w/ no wildcards returns itself

by jeberle (Initiate)
on Aug 23, 2011 at 19:32 UTC ( #921979=note: print w/ replies, xml ) Need Help??


in reply to Re: a glob w/ no wildcards returns itself
in thread a glob w/ no wildcards returns itself

Thank you Eliya. The use case I have is to do actual file matching, where the user specifies the pattern. For this, the behavior is counter-productive. Therefore:

$ perl -le 'print grep { -f } glob "foo.c"'
will have to rule the day.

In bash you can do:

$ shopt -s nullglob $ echo foo.?
but then ls generates full dir listings on failed globs.


Comment on Re^2: a glob w/ no wildcards returns itself
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (8)
As of 2015-07-03 20:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (56 votes), past polls