my @orig = ($/, $\); undef($/); undef($\); open (JE, $file) || die "Cannot open $file"; (my $j = ) =~ s/orig/new/g; #### close (JE); open (JE, "> $file); print JE $j; close (JE); ($/, $\) = @orig; #### seek (JE, 0, 0); print JE $j; close (JE); ($/, $\) = @orig;