# 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); }
1.4m articles
1.4m replys
5 comments
57.0k users