where $filepath = 'c:\windows\foo\bar\quux\baz.txt'; Hope that helps,if ($filepath =~ /([^\/\\]+)$/) { $file = $1; } else { $file = $filepath; }
In reply to (smitz)Re: Extracting filename from a path string
by smitz
in thread Extracting filename from a path string
by Snaps_Provolone
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |