#!/bin/perl -ni.bak print } BEGIN { scalar <>; scalar <>; scalar <>; print "This text replaces the third line.\n"; } {