On Thu, Mar 20, 2008 at 8:50 AM, sivasakthi <[EMAIL PROTECTED]> wrote:
> Hi all,
>
>  How to form array by using the files available in particular directory ?
snip

my @list_of_files = </tmp/*>;

However, this is not a good idea.  Do you know how many files are in
that directory?  If it is an extraordinarily large directory with
large file names you could eat up a lot of memory.  Most of the time
you want to process each file in a directory by itself, so you don't
need an array, just a way to iterated over the items in the directory.
 Perl provides the opendir*, readdir**, closedir*** functions to let
you do this.

* http://perldoc.perl.org/functions/opendir.html
** http://perldoc.perl.org/functions/readdir.html
*** http://perldoc.perl.org/functions/closedir.html

-- 
Chas. Owens
wonkden.net
The most important skill a programmer can have is the ability to read.

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


Reply via email to