其功能是读出指定目录下的文件名列表,写入到一个文本文件中,这是我写的第一个完整的PERL小程序,网上的PERL代码片段太少,共享出来供初学者参考学习:
#Author: Irving Ou #Date: 2008-6-10 #! perl -w use strict; use FileHandle; #Using the array to Get the list of inputting directory instead of prompting user to input #print "input the directory you want to list: /n"; #$DirName = <STDIN>; # ============= you can insert a great deal of DIR here ============ my @DirName = qw{G:/MovieFromDeng}; #E:/OY/Project/Perl/Exercise #"c:/"}; foreach (@DirName) { &ListOneDir($_); } sub ListOneDir { my $DirName = shift; my $fullname = undef; #
用PERL语言写的第一个实用小程序
最新推荐文章于 2024-07-13 14:09:23 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)