Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Read first line from each file in a directory

by mr.nick (Chaplain)
on Dec 16, 2011 at 16:24 UTC ( #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 ...


Comment on Re: Read first line from each file in a directory
Select or Download Code
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
Node Status?
node history
Node Type: note [id://943963]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (16)
As of 2014-08-22 19:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (163 votes), past polls