abs_path my $abs_path = abs_path($file); Uses the same algorithm as getcwd(). Symbolic links and relative- path components ("." and "..") are resolved to return the canonical pathname, just like realpath(3).