in reply to Pattern matching
($file_name) = $path =~ /([^\\]*)$/;
But paths can often be seperated with "/", even in Windows. Modules usually know details like this, which is why it's usually important to use them. Refer to File::Basename.
($file_name) = $path =~ m#([^\\/]*)$#;
|
|---|