From: Daniel Carrera Date: 2002-12-07T04:52:16+09:00 Subject: File I'm trying to figure out how to use File. I want to read each line, process it, print that to another file, and then rename the output file. This is how I'd do it in Perl: open ORIG, "<$filename"; open TEMP, ">.$$.tmp"; while () { s/
//g;
    s/<\/pre>/<\/code>/g;
    print TEMP
}
close ORIG;
close TEMP;

rename ".$$.tmp", "$filename";


I can do the REGEX part:

line.gsub!(/
/, '')
line.gsub!(/<\/pre>/, '')

But I need help with File.

Thanks,
Daniel.