my $searchpath="/usr/storage"; print "Here are the contents of the chosen search path\n"; sleep 2; my @files = <$searchpath/*>; foreach my $file (@files) { print $file . "\n"; } #### /usr/storage (top level directory) location1 (this is a directory) location2 (this is a directory) afile1 (this is a file) afile2 /usr/storage/location1 afile2 afile3 location3 (this is a directory) /usr/storage/location2 afile /usr/storage/location1/location3 afile afile1 afile2