my ($name) = $file=~/\\([^\\_]+)_/;
1 2 3 4 5 6
use File::Spec; #... my $name=File::Spec->splitpath( $file ); $name=~s/_.+?$//;