Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re:{2} Printing to a specific place in a file

by jeroenes (Priest)
on Oct 04, 2001 at 19:36 UTC ( #116736=note: print w/ replies, xml ) Need Help??


in reply to Re: Printing to a specific place in a file
in thread Printing to a specific place in a file

You can make it even simpler:

#!/usr/bin/perl -i.bak -wp c:/test.txt print "newline\n" if m/somecond/; s/this/that/;

IMHO command line switches are a Good Thing (tm).


Comment on Re:{2} Printing to a specific place in a file
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (11)
As of 2015-07-28 17:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (258 votes), past polls