I want to grab the file name without the extension and without using a
module. I have a working solution with two regular expressions but I
wonder if it can be done with only one regional expression.
For all the following $node_path the $node_body should be "file".
my $node_path = 'c:/dir.1\dir2\file.bin';
my $node_path = 'c:/dir.1\dir2\file';
my $node_path = 'file.bin';
(my $node_body = $node_path) =~s/.*?([^\\\/]*)$/$1/;
$node_body =~s/\.[^\.]*\s*$//;
print $node_body; # file
