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

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

Comment on Re: Shell expansion with is funky
Download Code

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 avoiding work at the Monastery: (8)
As of 2015-12-01 16:20 GMT
Find Nodes?
    Voting Booth?

    My keyboard shows this many letters:

    Results (18 votes), past polls