#!/opt/local/gnu/bin/perl -w $tmp = "tmp$$"; foreach $file (@ARGV) { system( "gunzip $file" ); $file =~ s/.gz$//; open(FILE, "<$file"); open(TMP, ">$tmp"); while () { s/#Common(Blocks)/#$1CommonToAllCompletions/; print TMP $_; } close(TMP); system( "mv $tmp $file; gzip $file" ); }