in reply to Re: Re: Re: Re: Producing 2 lists from a grep call
in thread Producing 2 lists from a grep call

I think we can agree that the FOR LOOP/IF STATEMENT is probably a nicer solution ? :)
Especially since it's almost the for loop I posted - just s/map/for/, pull the (readdir DIR) up top, slip a next into the loop, and there you have it.

If you actually want something that's not a for loop in disguise, you could pull a really horrible trick like
my @dir; my @files = map { ($_ ne '.') && ($_ ne '..') && -d "$base/$_" ? do { push @dir, $_; () } : -f "$base/$_" && $_ } readdir DIR;
But if the Communications Decency Act had gone through I wouldn't have been able to even post this.

Makeshifts last the longest.