# test-> a.pl
my $file = '/home/joe/test'; if ( -f $file && -l $file ) { print readlink( $file ) ; }
how to get the Absolute Path for symlink file ?
Cwd provides such functionality by abs_path.
#!/usr/bin/perl -w use Cwd 'abs_path'; my $file='/home/joe/test'; if( -f $file && -l $file ) { print abs_path($file); }
2.1m questions
2.1m answers
60 comments
57.0k users