my ($in, $out) = @ARGV; open(EXT, "<", $in); open(SCO, ">", $out); while () { s/SEED\s+(\d+)/srand($1);$&/e; s/rand\(\d*\)/eval $&/ge; print SCO; }