Thanks Thomas... :)
It helped.

~~~~~~~~~~~~~~~~~~~~
Thanks and Best regards,
~ Rajnikant
Software Engg.
Persistent Sys. Ltd.
Ph. +91 98222 04088

-----Original Message-----
From: Thomas Bätzler [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 05, 2008 5:50 PM
To: beginners@perl.org
Cc: Rajnikant
Subject: RE: about readdir call

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/



DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the 
property of Persistent Systems Ltd. It is intended only for the use of the 
individual or entity to which it is addressed. If you are not the intended 
recipient, you are not authorized to read, retain, copy, print, distribute or 
use this message. If you have received this communication in error, please 
notify the sender and delete all copies of this message. Persistent Systems 
Ltd. does not accept any liability for virus infected mails.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to