use File::Find; @crap = (); finddepth (\(&wanted(\@crap)), $TMPDIR); print "crap is: @\n"; sub wanted { $in = $_[0]; push @$in, "dude"; }