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