in reply to Producing 2 lists from a grep call

What you've got works, but if you're concerned about space overhead, you could do something like
foreach my $file ( readdir(DIR) ) { push @dirs, $file if -d "$base/$file" and $file ne "." and $file ne ".."; push @files, $file if -f "$base/$file"; }