Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: Is there a better way.

by afresh1 (Hermit)
on Feb 25, 2009 at 21:34 UTC ( [id://746387]=note: print w/replies, xml ) Need Help??


in reply to Re: Is there a better way.
in thread Is there a better way.

The way I normally do this is similar, but skips using the temporary @files array.

opendir my $dh, $dir or die "Unable to opendir [$dir]: $!"; my @uploads = grep /$pattern/, readdir ($dh); closedir $dh;

Sometimes I will add a map { "$dir/$_" } between = and grep, but it depends on the use.

l8rZ,
--
andrew

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2024-03-29 00:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found