my @list; find( \&wanted, '.'); say for @list; sub wanted { return unless -f; push @list, $File::Find::name; }