Rajnikant <[EMAIL PROTECTED]> asked:
> I'm reading one directory using readdir call. but I'm getting
> different output from that I got by running ls -l command on
> same directory manually. Following is the snippet I'm using:
>
#!/usr/bin/perl -w
$dirname = '/test_dir';
opendir ( DIR, $dirname ) || die "Error in opening dir $dirname\n";
foreach my $filename (sort grep { !/^\.\.?$/ } readdir(DIR)){
print("$filename\n")
}
closedir(DIR);
__END__
HTH,
Thomas
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/