our @list; findfile('*'); sub findfile{ my $glob = shift; for ( glob $glob ){ push( @list, $_) if -f; findfile( $_.'/*' ) if -d; } }