|
|
|
|
 PERL文件操作 - perlwind [ 2005-05-12 12:49 | 66 byte(s)]
 Re: PERL文件操作 - Viperii [ 2005-05-12 14:00 | 223 byte(s)]
 Re: PERL文件操作 - perlwind [ 2005-05-12 16:01 | 351 byte(s)]
 Re: PERL文件操作 - realinux [ 2005-05-28 21:56 | 86 byte(s)]
|
|
|
|
[Original]
[Print]
[Top]
|
my @a = ();
opendir(DIR, $dir) or die "oops: $!";
while(defined(my $file = readdir(DIR)))
{
push(@a, $file);
}
closedir(DIR);
|
|
|
----
Where is the RED pill? I want OUT!
|
|
[Original]
[Print]
[Top]
|
|
[Original]
[Print]
[Top]
|
感谢二楼的,我已经搞定了,项目要求我是取到全路径,我顺便改了一下.
opendir(md,$file);
@list = readdir(md);
splice(@list,0,2);
for( $count = 0; $count < @list; $count++ )
{
$list[$count] = join("","$file","/", $list[$count]);
}
closedir(md);
|
|
|
[Original]
[Print]
[Top]
|
|
|