in reply to how to get the parent directory name?

Yet another way to do it:

use Path::Class qw(dir); my $dir = dir(); # current directory my $parent = $dir->parent; # or more directly $parent = dir()->parent;

-xdg

Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.