#!/bin/perl local $^I = "sub/.bak"; local @ARGV = ('/home/antony/perl/l.pl'); while ( <> ) { s/instance/NEW_PATTERN/; print; }