in reply to Re: Read first line from each file in a directory
in thread Read first line from each file in a directory

Already did, they work.

  • Comment on Re^2: Read first line from each file in a directory

Replies are listed 'Best First'.
Re^3: Read first line from each file in a directory
by mr.nick (Chaplain) on Dec 16, 2011 at 16:31 UTC
    I doubt that. As choroba stated, you are actually trying to open a file named $file.

    mr.nick ...

      I tried it without quotations, and it adds a new warning: "readline() on closed filehandle WRITE"

      and I did check opendir and readdir, they both work. Also, I'm not working in the root folder by accident

Re^3: Read first line from each file in a directory
by Tux (Canon) on Dec 16, 2011 at 16:36 UTC

    And your opendir will only work (by accident) if you are in the root folder when you start the script.


    Enjoy, Have FUN! H.Merijn