If using a regexp...:
if( $string =~ m$! ) { print $1, "\n"; }
This works as long as you're dealing only with paths where there isn't a trailing filename. And of course it would run amok if the path didn't start with either a / or a \, or if a directory name allowed embedded / or \ characters. :) caviet lector.
Dave
In reply to Re: get folder name only
by davido
in thread get folder name only
by johnajb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |