# 测试-> a.pl
my $file = '/home/joe/test';
if ( -f $file && -l $file ) {
print readlink( $file ) ;
}
如何获取符号链接(symbolic link)文件的绝对路径?
最佳答案
#!/usr/bin/perl -w
use Cwd 'abs_path';
my $file='/home/joe/test';
if( -f $file && -l $file ) {
print abs_path($file);
}
关于perl - 如何获取符号链接(symbolic link)文件的绝对路径?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4887672/