Format of options file

iz ilainftw at gmx.com
Tue Mar 6 06:09:55 PST 2018


> > binmode does still work AFAIK, but a more modern and flexible method
> > is to use the crlf I/O layer, which is documented here:
> >   https://perldoc.perl.org/PerlIO.html
> >
> > Note however that an awful lot of perl code just doesn't bother.
> 
> Windows stacks the `:crlf' layer by default.  I *think* Richard's trying
> to avoid that because he wants his get_iplayer to use POSIX text files
> on Linux, as normal, and Windows.

PerlIO enables you to go either way, and no code changes are necessary. The simplest solution is to run the equivalent of 'PERLIO=crlf get_iplayer [...]' on Linux, perhaps via an alias in your shell. Probably best not to set PERLIO=crlf permanently if you run other Perl programs. You may not like having files with CRLF line endings, but they will still work on both platforms if you screw up editing and get mixed line endings. If you really can't abide CRLF, use PERLIO=perlio on Windows instead to produce LF line endings. Probably simplest to set it locally in the get_iplayer batch file. You just have to be careful not to inject CRLF line endings if you edit any files directly, though I would expect any decent text editor on both platforms can avoid that.



More information about the get_iplayer mailing list