use strict; use warnings; use File::Find; my $dir= '/some/directory'; finddepth(\&printme, $dir); sub printme { print $File::Find::name,$/; }