in reply to flock on on $^I

I'm not able to change that at present for reasons I can't go into.

How do I survive jumping out of a highflying aircraft without using a free, easily available parachute? Sigh. Sounds more like a political problem than a perl problem.

Anyway. Look in "perldoc perlrun" under -i to see the demo equivalent of inplace editing, then reimplement including the desired changes. You're stuffing the filename into @ARGV not passing it in from the command line, and there's only one at a time, so those aren't a problem. I don't really see why you are so tied to the default implicit behaviors.