Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: multi-line in-place edits

by halley (Prior)
on Feb 15, 2005 at 19:23 UTC ( #431302=note: print w/replies, xml ) Need Help??

in reply to multi-line in-place edits

I am not sure I understand the value of your task (or what you meant by adding \266 bytes). Are you trying to undo a command-line mistake? Are you trying to use some tool that avoids working inside braces, so you're wrapping the file in braces? It all sounds odd. This doesn't work,
perl -p -i -e 'BEGIN { print "{" } END { print "}" }' filename.txt
but this does. Not as quick to type, but...
echo "{" >tmp cat filename.txt >>tmp echo "}" >>tmp mv tmp filename.txt

[ e d @ h a l l e y . c c ]

Replies are listed 'Best First'.
Re^2: multi-line in-place edits
by Tuppence (Pilgrim) on Feb 15, 2005 at 20:08 UTC

    I provided a simplified example to get the multi-line edit syntax worked out.

    I was attempting to do some code refactoring with in-place editing, when due to failing memory I replaced all the \n's with a upper ascii char. I managed to get that fixed, and just needed the correct syntax for multi line edits.

    -l0666 is so close to the -0777 that I really needed I think perl should have just known I was doing the wrong thing and Done the Right Thing ;) /joke

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://431302]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2018-05-20 20:03 GMT
Find Nodes?
    Voting Booth?