Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re: Shell expansion with is funky

by Masem (Monsignor)
on Jan 25, 2002 at 01:10 UTC ( #141333=note: print w/replies, xml ) Need Help??

in reply to Shell expansion with <> is funky

The glob command is much better; pass it a wildcard-embedded string, and it returns a list of filenames that match it (assuming in CWD). If you need DOS-based matching, you can use File::DosGlob to replace the system glob with a slightly different version. In your code, specifically:
my @files = glob "$fpcdir/$project/*fpc"; foreach my $file ( @files ) { open FH, "<$file" or die $!; while (<FH>) { # inner loop unchanged... } close FH; }

Dr. Michael K. Neylon - || "You've left the lens cap of your mind on again, Pinky" - The Brain
"I can see my house from here!"
It's not what you know, but knowing how to find it if you don't know that's important

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (10)
As of 2016-10-26 21:22 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (349 votes). Check out past polls.