Help for this page
foreach (@files) { ... $_ = map m{([^/]+)\.txt}, $_; #Strip out of the string the path + and extension leaving only the filename intact ... }
( my $name ) = m{ ([^/]+) \.suffix }x; ... use File::Basename; my $name = fileparse( $_ , qr{ \.suffix }x );