So now how about wrapping this up in a module, and having the script
use that? That way Ronald's CGI could use it. Also I notice that
Mark Veltzer's Meta distribution has a subset of this functionality,
in Meta::Utils::Dos. Wouldn't be surprised if other people have modules
doing some of this stuff too.
Text::CRLF? Interface?
$crlf = Text::CRLF->new();
# default behaviour - convert to my platform, from STDIN to STDOUT
$crlf->convert();
# a dos2unix filter
$crlf->dos2unix($INFILE, $OUTFILE);
# i don't care where it came from, just where it's going
$crlf->to_unix($INFILE, $OUTFILE);
Hmm, you can't have a sub called 2unix(), so maybe the other methods
should be called dos_to_unix ...?
I'll write the testsuite.
Neil