in reply to Re: reading directories
in thread reading directories

what if you want to avoid some files other than the dot files, like some other programs that you may have in the dir. And how would you just get file e.g., file.1,file.2, file.3 etc.

Replies are listed 'Best First'.
Re: Re: Re: reading directories
by HamNRye (Monk) on Sep 19, 2001 at 02:18 UTC

    I'm not sure exactly what you want to do....

    Basically, you have all of your file names in the array @files. You can use a do...for loop

    for (@files) { /\.txt/ && do { print; }; }

    This prints the name of all text files.

    for (@files) { !/\.txt/ && do { print; }; }

    This prints the names all non .txt files (note negation)

    <code> for (@files) { /^ignore?$/ && do { print; }; }

    Will skip all filenames beginning with ignore.

    You should be getting the idea. ~Hammy