in reply to Producing 2 lists from a grep call
Don't try to cooerce everything into a grep.my @dirs; my @files; for (readdir DIR) { next if $_ eq "." or $_ eq ".."; if (-d "$base/$_") { push @dirs, $_; } else { push @files, $_; } }
-- Randal L. Schwartz, Perl hacker
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: •Re: Producing 2 lists from a grep call
by Anonymous Monk on Jun 17, 2002 at 12:02 UTC |