use strict; use Cwd 'abs_path'; my $fileinquestion = "/var/mail/"; my $realpathfor = abs_path($fileinquestion); print "$realpathfor\n"; #### pwd -P #### #!perl use strict; use Cwd; use Cwd 'abs_path'; my $q = 'C:\\TEMP\\'; chdir $q; my $dirnow = getcwd(); print "Changed dir to C:\\TEMP\n"; print "Cwd thinks I am in $dirnow\n"; chdir "..\\"; print "Changed dir up one level ..\n"; my $newdirnow = getcwd(); print "Cwd now thinks I am in $newdirnow\n";