From: Uri Guttman on
>>>>> "RLS" == Randal L Schwartz <merlyn(a)stonehenge.com> writes:

>>>>> "Uri" == Uri Guttman <uri(a)StemSystems.com> writes:
Uri> i hate all the duplicate pushes. try this on for size (untested :):

Uri> use File::Slurp ;
Uri> push( @{ -d "$folder/$_" ? \@folders : \@files }, $_ ) for read_dir( 'C:' );

Uri> that assumes if it ain't a dir, it is a file.

RLS> OP said he was working through "Learning Perl". Probably hasn't
RLS> gotten to references yet, so you just blew his test score. :)

well, you may have missed my smiley before the code. that wasn't
intended as a real useful answer. but the technique of selecting what
array to push onto is useful occaisionally.

uri

--
Uri Guttman ------ uri(a)stemsystems.com -------- http://www.sysarch.com --
----- Perl Code Review , Architecture, Development, Training, Support ------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------