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).