Today, I wrote a file rename tool with Perl and experienced a little convenient to handle files with Perl. For example, all files and directories under the specified directory:
# First open the specified directory with OpenDir
OpenDir (des_dir, "c: // tem //");
# Get the files and directories inside
@file_list = readir (des_dir);
# shut down
CloseDir (des_dir);
All files and directory names in this directory are put in the array @file_list, which is more simple to compare with C / C . However, because of the time of being unfamiliar with Perl, the time of checking the information is used for 4 hours. Oh, I have a little bit ~: p
By the way, you can record the beneficial information found:
1,
Perl 5 tutorial:
Http://oldsite.linuxAid.com.cn/download/support/perl_teach/
Chinese Perl Tutorial, there is also a very worthwhile collection of Perl functions.
2, Perl book download:
http://www.linuxforum.net/forum/showflat.php?cat= 2510009&page=0&ok=collapsed&sb=5&o=collapsed&sb=5&o=collapsed&sb=5&o=