Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Read first line from each file in a directory

by mr.nick (Chaplain)
on Dec 16, 2011 at 16:24 UTC ( [id://943963]=note: print w/replies, xml ) Need Help??


in reply to Read first line from each file in a directory

Try testing if your opendir and open succeeded.

mr.nick ...

Replies are listed 'Best First'.
Re^2: Read first line from each file in a directory
by Anonymous Monk on Dec 16, 2011 at 16:28 UTC

    Already did, they work.

      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

      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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://943963]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (7)
As of 2024-03-29 08:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found