in reply to Re: CPAN module unit test issues: OS line endings (how?)
in thread CPAN module unit test issues: OS line endings

How did you write such fragile or broken code that it breaks in the face of different (but native) line endings despite Perl pretty much taking care of that for you automatically?

It could well be that tar is the fly in the ointment.
When downloading from CPAN one is generally grabbing tarballs, and the text files in those tarballs most commonly have nix line endings.
Most Windows tar utilities can, I think, be configured to convert the line endings to Windows format but I've been bitten by configuring tar that way. (On rare occasions it would consider a binary file to be text.)

As a consequence of that, I for one, always untar CPAN tarballs "as is" on Windows - which means that the unpacked text files most commonly contain nix endings.
And I doubt that I'm the only person doing that.

This makes it difficult for a CPAN author to know whether the unpacked distro on a Windows machine will have nix or windows line endings - and I think the best general advice is to construct things such that there's no need to know this.

Cheers,
Rob

Replies are listed 'Best First'.
Re^3: CPAN module unit test issues: OS line endings (tar)
by tye (Sage) on Sep 18, 2015 at 03:24 UTC
    Most Windows tar utilities can, I think, be configured to convert the line endings to Windows format but I've been bitten by configuring tar that way.

    Getting either Unix or Windows line endings in text files when on Windows should not present a problem (to mundane Perl code).

    - tye        

      Getting either Unix or Windows line endings in text files when on Windows should not present a problem (to mundane Perl code).

      I'm not suggesting otherwise.

      Cheers,
      Rob

        Yeah, I wasn't disagreeing with anything you said. Just pointing out why I think it unlikely to apply in this situation doesn't matter as far as how the code should work. Thanks.

        - tye