Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: updating to a file

by Jaap (Curate)
on Sep 21, 2005 at 10:50 UTC ( #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? | Other CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2021-09-19 15:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?