All files and directories in the specified directory are obtained in Perl

xiaoxiao2021-03-06  62

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=

转载请注明原文地址:https://www.9cbs.com/read-82176.html

New Post(0)