On Thu, Mar 20, 2008 at 9:16 AM, Süleyman Gülsüner
<[EMAIL PROTECTED]> wrote:
> Hi,
>
> You can use opendir, readdir and may play with grep as below;
>
> opendir $dir, '/tmp' or
> @list = grep ! /^\.\.?$/, readdir($dir);
> grep to remove '.' and '..'
snip
This isn't anymore efficient than
Hi,
You can use opendir, readdir and may play with grep as below;
opendir $dir, '/tmp' or
@list = grep ! /^\.\.?$/, readdir($dir);
grep to remove '.' and '..'
@list = grep ! /^\.+/ # you can remove '.' , '..' and hidden files
@list = grep /\.txt$/ # only txt files
etc
suleyman
On
On Thu, 2008-03-20 at 18:20 +0530, sivasakthi wrote:
> Hi all,
>
> How to form array by using the files available in particular directory ?
>
> for example, /tmp contains the following files..
>
> #ls /tmp
> example.txt
> file1.txt
> file2.txt
> file3.txt
> sample.txt
> www.txt
> zzz.txt
>
>
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 = ;
However, this is not a good idea. Do you know how many files are in
that directory? If it is an extraordinari