in reply to Re^2: -f not identifying .txt files
in thread -f not identifying .txt files

rucha:

If I had to guess, I'd guess that you have the .pl and .pm files in your current directory, and that d:/perlnew/ex/comp is a test directory, which contains the .pl and .pm files, along with other files. Since there's no directory prefix, the -f function is checking your local directory rather than the directory you've done the readdir from.

If your current directory is actually d:/perlnew/ex/comp when you run your script, then I can't think of a reason that readdir would see the files and -f wouldn't.

...roboticus

Replies are listed 'Best First'.
Re^4: -f not identifying .txt files
by rucha (Initiate) on Sep 24, 2010 at 10:51 UTC

    Hi, the file I'm running is in D:/perlnew/ex
    Its path is D:/perlnew/ex/ex_59a.pl

    The program is extracting(?) filenames from the specified directory (which I passed as the argument), not my current directory..

      rucha:

      As I suspected ... then apply tirwhan's patch, and you should be good to go.

      ...roboticus

      Update: Added link and fixed typo (sorry, tirwhan, I misspelled your name the first time!)