On Sep 28, ZHAO, BING said:

Is there a way to call or maybe get the # of files in a directory?

The simplest way is to use opendir() and readdir().

  opendir my($dh), $path or die "can't opendir $path: $!";
  my @files = readdir $dh;
  closedir $dh;

Now you have the files from the directory $path in the array @files. The number of elements is the number of files.

--
Jeff "japhy" Pinyan        %  How can we ever be the sold short or
RPI Acacia Brother #734    %  the cheated, we who for every service
http://www.perlmonks.org/  %  have long ago been overpaid?
http://princeton.pm.org/   %    -- Meister Eckhart

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


Reply via email to