toby@ovod-everett.org via RT wrote:
Show quoted text>> Perl has been able to deal with Windows vs Unix line endings for years
>> now. So do most editors and browsers. Given that, is this sort of
>> fastidiousness is necessary anymore? I don't think there's anything
>> wrong with shipping a Windows newline terminated Build.PL or MANIFEST.
>
> Unfortunately, however, the only guaranteed available text editor on a Win32
> box is Notepad, which doesn't handle Unix line endings. If someone is working
> on a machine on which they do not have local Admin rights, or on which they do
> not want to install unnecessary software (and a freeware text editor may fall
> into that category - every piece of software installed is yet another piece of
> software that must be tracked for possible security updates, and so adds to
> the administrative headache), the only editor they can be sure of having is
> Notepad, and so I try to be kind where I know it won't screw up anything. It
> is true that WordPad will handle Unix line endings, but WordPad is not a text
> editor - it's a weak word processor, and using it to edit text files always
> makes me a tad leary. The Win32 side executes Perl code with Unix
> terminations perfectly well, however, and it reads Unix line termination
> sequences in files transparently.
I'm sorry to say, but this sounds like Module::Build bending over backwards to
support an anemic development environment. Someone trying to work on that
machine is going to be going insane 90 different ways anyway, a Unix
terminated file is going to be the least of their worries if all they have is
Notepad.
And hey, they have perl. Fix the newlines: perl -i -pe 's{\015\012?}{\n}g;'
Also, one does not edit the META.yml, MANIFEST, Makefile.PL or README -- any
of the Module::Build generated files -- by hand. There's little reason you're
going to be looking at or altering them on a locked-down, stripped-down
Windows machine.
Finally, worrying about newlines is only useful for unportable modules...
Win32 or Unix-specific code. A cross-platform module should not care. If the
module only runs on Windows then under what conditions will you roll a
distribution on Unix?
So I remain unconvinced that the effort will produce anything useful.
Have you run into this problem in the real world or is this a hypothesis?
Show quoted text> As for the Unix side, I know in the past that I've seen issues with DOS
> line-termination sequences when executing Perl on Unix boxes, so I've tended
> to be conservative.
If you have examples of this, please report it to perlbug. There should be no
issues.
Show quoted text> Finally, Unix Perl doesn't transparently strip DOS
> line-termination sequences. Run the following code against a DOS
> line-terminated file under both Unix and Win32:
> while (<STDIN>) {
> chomp;
> print "'$_'\n";
> }
> Thus my conservativism. ;)
While that may be true, this issue doesn't effect any of the Module::Build
generated files.
--
We do what we must because we can.
For the good of all of us,
Except the ones who are dead.
-- Jonathan Coulton, "Still Alive"