实现的功能很简单,将文本文件中的内容逐行打印到屏幕。 #!/usr/bin/perl use 5.006; use strict; use warnings; use IO::File; my $file = shift; my $fh = IO::File->new($file); while(<$fh>) { print; } 测试执行命令 perl getlocalfile.pl getlocalfile.pl