Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://921979]
and the fire pops...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2017-06-23 01:10 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (533 votes). Check out past polls.