Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: updating to a file

by Jaap (Curate)
on Sep 21, 2005 at 10:50 UTC ( [id://493724]=note: print w/replies, xml ) Need Help??


in reply to updating to a file

Simply open the file in append mode:
if (open (my $fh, '>>', "manager.properties")) { print $fh "test\n"; close ($fh); }

Replies are listed 'Best First'.
Re^2: updating to a file
by rev_1318 (Chaplain) on Sep 21, 2005 at 11:23 UTC
    That solves only the overwrite problem. Appending to a file doesn't solve the update problem. For that, you need inplace edit (as GrandFather shows), or via a Tie to the file. But then, a different data structure would be more suitable.

    Paul

Log In?
Username:
Password:

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

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

    No recent polls found