use strict; my @array = (); my $ext = '*.*'; my @verz = ('/verzeichnis'); for my $file (@verz) { next unless -d $file; chdir $file or warn "Could not change into directory $file: $!"; for (glob($ext)) { push @array,$file . '/' . $_; } opendir DIR,$file or warn "Konnte Verzeichnis $file nicht öffnen: $!"; push @verz,map { $file . '/' . $_ } grep !/^\.\.?$/, readdir DIR; closedir DIR; } print join '|',@array;