.recurser.pl: #!/usr/bin/perl # automagical-develop-and-do-what-you-want # licenced by your monthly # abZurd.org or abZurd-affiliate visit ;) # http://abzurd.com/legal/licence/automagical # easily install by following next three steps # step 1: # make sure you are programming in perl # yes?, ok, place sub in code :] sub recurse { my $dir = shift; my $action = shift; print "this isn't a dir! ($dir)\n" unless (-d $dir); opendir(DIR,$dir); foreach(readdir(DIR)) { if ($_ =~ /^\..?.?$/) { next; } if (-d "$dir/$_") { &recurse("$dir/$_",$action); } else { &$action("$dir/$_"); } } } # onwarths with the fun part # step 2: # create a sub that does something with all those # digital hunks of data (all bought and paid are they?) sub doMeCauseItHurts { printf "%s\n",shift; # ohyeah,ls -R|dir/s functionality ;) } # step 3: # just call it on the dir and pass it a reference to your sub: &recurse($ENV{USERPROFILE},\&doMeCauseItHurts);