Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Producing 2 lists from a grep call

by marvell (Pilgrim)
on Jun 17, 2002 at 12:29 UTC ( [id://175059]=note: print w/replies, xml ) Need Help??


in reply to Producing 2 lists from a grep call

How about something that is like the following pseudo code:
for $item @list { next if definite failure condition action if most likely condition action if next most likely condition etc. default action }
Giving you:
for (readdir DIR) { next if $_ eq '.' || $_ eq '..'; push (@files,$_) && next if -f $base/$_; push (@dirs,$_) && next if -d $base/$_; # default to no operation }
I imagine this will look a lot more elegant with the new perl 6 switch statement.

--
Steve Marvell

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-04-19 06:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found