use strict; use warnings; use Cwd; use File::Spec; my $parent = Cwd::realpath(File::Spec->updir); print "Parent directory: $parent";