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

Re: Shell expansion with is funky

by Masem (Monsignor)
on Jan 25, 2002 at 01:10 UTC ( [id://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; }
</CODE>

-----------------------------------------------------
Dr. Michael K. Neylon - mneylon-pm@masemware.com || "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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (6)
As of 2024-04-23 13:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found