Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re^3: Need a little help appending lines

by macrobat (Beadle)
on Sep 12, 2007 at 21:11 UTC ( [id://638682]=note: print w/replies, xml ) Need Help??

in reply to Re^2: Need a little help appending lines
in thread Need a little help appending lines

It's a bad idea to edit a file in-place without a backup, let's just put it that way. Creating a separate output file from your source means your source *is* the backup. So moritz's point, a little less succinctly put, is, "Don't edit a file with important data unless you can undo any changes."

(Or use version control.)
  • Comment on Re^3: Need a little help appending lines

Replies are listed 'Best First'.
Re^4: Need a little help appending lines
by shmem (Chancellor) on Sep 12, 2007 at 21:23 UTC
    Precaution against data loss is an entirely different thing, though related. But that concern doesn't justify marking in-place edits as bad idea, more so generally.

    Perl wouldn't have the -i switch if doing in-place edits wasn't a good idea. Generally speaking.


    _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                  /\_¯/(q    /
    ----------------------------  \__(m.====·.(_("always off the crowd"))."·
    ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

Log In?

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2024-06-25 04:42 GMT
Find Nodes?
    Voting Booth?

    No recent polls found

    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.