Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: How would I do an inplace edit, prepending

by coolmichael (Deacon)
on Feb 10, 2001 at 11:45 UTC ( #57600=note: print w/replies, xml ) Need Help??

in reply to How would I do an inplace edit, prepending '~foo' to every key of a hash? (was: How would I do an inplace edit, prepending)

perl -pi.bak -e "print qq(this is a test\n) if ($.==1);" data.txt

All I did was look at perldoc:perlrun. I seem to remember something else about prepending stuff to a file somewhere on perl monks. It can't be that easy can it?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://57600]
[marto]: a security event in the building, police dogs and and so on...
[Discipulus]: a test I hope..
[marto]: just a security event, they have people from the 'corporate' security, external security companies, the police etc
[marto]: perhaps I'll get the time to pin down some of the corporate security people, since they refuse to answer any questions

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2017-11-22 10:25 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (317 votes). Check out past polls.