Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Using read/write to update a file

by toolic (Bishop)
on Oct 14, 2014 at 18:51 UTC ( [id://1103789]=note: print w/replies, xml ) Need Help??


in reply to Using read/write to update a file

In your code, print prints to STDOUT, not your myfile.csv file. You could specify the DATA filehandle, but I think you'll just be appending lines, not replacing them. Consider Tie::File.

Replies are listed 'Best First'.
Re^2: Using read/write to update a file
by MidLifeXis (Monsignor) on Oct 14, 2014 at 18:57 UTC

    I believe that you will end up overwriting the next record, not appending. So if you start with a file

    afoo bfoo cfoo dfoo
    you should end up with
    afoo abar cfoo cbar

    (untested)

    --MidLifeXis

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (4)
As of 2024-04-23 05:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found