如下,想要获得11.pl的路径,相对路径和绝对路径:
zczhangjx@zctech-chengjb:~/智呈监控系统/shell-perl$ ./11.pl ./11.pl /home/zczhangjx/智呈监控系统/shell-perl/11.pl
#!/usr/bin/perl use File::Basename; print "$0\n"; use Cwd 'abs_path'; use warnings; print(abs_path($0)."\n");