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