Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^3: Read/Update File

by rpike (Scribe)
on Aug 25, 2010 at 15:35 UTC ( #857222=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Read/Update File
in thread Read/Update File

Thank you for the post. Most helpful. :-) I've been trying to use +> to open the file for read/write purposes but cannot read the contents in. I'm trying to read the contents into an array such as (simpler version) but it isn't working :

open (FH, ">+path"); my @lineArray = <FH>; print join("<br>", @lineArray); # nothing prints although the file do +es have content
Is there something I have to do with buffering? Reading from the handle in this way is no good when opening for read/write? Any help on this would be most appreciated as well. Thanks.


Comment on Re^3: Read/Update File
Download Code
Re^4: Read/Update File
by Anonymous Monk on Aug 25, 2010 at 19:36 UTC
    > means clobber (overwrite) file , means you get empty file each time, you want +< for read/write. See open

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2014-09-21 17:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (173 votes), past polls