I would agree with the response above. Use File::Basename. It handles a lot of things you wouldn't necessarily think to include.
However, for the sake of completeness, there are a couple of ways you could do this:
( $filename ) = $tst =~ /^.*\\(.*)$/ $filename = ( split /\\/, $tst )[-1]In reply to Re: extract file name from a dynamic path
by harleypig
in thread extract file name from a dynamic path
by dani_cv
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |