in reply to opening all files in a directory

Use a plain readdir...
opendir(DIR,"."); @Files = readdir(DIR); closedir(DIR);
Greetz
Beatnik
... Quidquid perl dictum sit, altum viditur.

Replies are listed 'Best First'.
Re: Re: opening all files in a directory
by cLive ;-) (Prior) on May 14, 2001 at 07:59 UTC
    appendum... You might want to do this
    @Files = grep /\w/, readdir(DIR);
    to avoid reading . and .. into the array.

    cLive ;-)

    Update:d'oh - thanks Randal.

    Appendum to appendum... "assuming your file names containword chars".

      But that'll miss the perfectly legitimate file named "!!!". Why are you ruling all of those out?

      The most straightforward is:

      @files = grep { $_ ne "." and $_ ne ".." } readdir DIR;

      -- Randal L. Schwartz, Perl hacker