in reply to IO::Handles ... any good?

I have never used IO::Handle (without the "s"), but shift will remove the 1st argument on the command line for you:
my $filename = shift; open(PAGE, $filename) || die "I can't open yourfile.txt";

$filename would become "anyfile.txt" in your example command line.

Update: There are other ways of modifying a file in-place. A Super Search where title contains all of "edit", "file", "in", "place" show some ?node_id=3989;HIT=edit%20file%20in%20place;re=N

If your input file is large, these other methods would save memory by not storing the entire contents at once.

Replies are listed 'Best First'.
Re^2: IO::Handles ... any good?
by blowupp (Novice) on Mar 22, 2009 at 18:41 UTC

    I've been reading all afternoon your advice was perfect - thanks so much.