open (A, '+<', "somefile.html") or die $!; s/a/b/g for my @records = ; seek(A, 0, 0); print A @records;