for my $file ( $muh =~ /\s*([\w.-]+)/g ) { $file =~ s/\d\d-\d\d-\d\d$//; print "$file\n"; }