HTH & HAND,# I dislike having to escape everything when I can use '' instead $path = '\default\main\Anand\toipcs\Tutorials\internet'; $curPath = $path; $curPath =~ s!\\default\\main\\([^\\]*)\\Tutorials\\internet!$1!; $parentdir = $curPath; print "parent Directory : $curPath\n"; ($Pdir,$Sdir) = $parentdir =~ m!([^\\]*)\([^\\]*)$!; print "parent branch : $Pdir \t sub branch $Sdir";
In reply to Re: Get Parent Directory
by alfie
in thread Get Parent Directory
by Ananda
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |