Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Using read/write to update a file

by blue_cowdawg (Monsignor)
on Oct 14, 2014 at 18:51 UTC ( #1103788=note: print w/replies, xml ) Need Help??


in reply to Using read/write to update a file

Try this:

#!/usr/bin/perl -w use strict; use Tie::File; tie my @ry,"Tie::File","myfile.csv" or die $!; $_ =~ s/foo/bar/g for @ry; untie @ry;


Peter L. Berghold -- Unix Professional
Peter -at- Berghold -dot- Net; Blog: http://blog.berghold.net Warning: No political correctness allowed.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2023-03-20 19:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (59 votes). Check out past polls.

    Notices?