Just like the previous answer stated, Cwd qw(abs_path) would do the job just as realpath from the same module would do.
However, one really do not need the readlink function anymore because "..Symbolic links and relative-path components ("." and "..") are resolved to return the canonical pathname.." -- perldoc Cwd.
use Cwd qw(abs_path realpath); #.... my $absolute_path = abs_path($link); # or ... my $absolute_path = realpath($link);
In reply to Re^2: How to get the absolute path of a symbolic link
by 2teez
in thread How to get the absolute path of a symbolic link
by ZWcarp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |