in reply to CR/LF in bin

What would be a best practice for someone like myself who wants to roll distros on both linux and win32?

I was surprised that Writing Solid CPAN Modules doesn't offer any advice to CPAN authors on this topic, so I need to update it.

I've always assumed that if the text files (e.g. .pl and .pm files) in your uploaded CPAN tarball are Unix LF-terminated, they'll work fine on all modern Perl platforms (including Windows and MacOS). But I couldn't find a definitive reference on this topic ... so if anyone knows of any cool references on this topic, please let us know.

Update: I've made a minor tweak to the Mechanics of Creating a New CPAN Module section at Writing Solid CPAN Modules, shown below.

Mechanics of Creating a New CPAN Module

Start with: Re: What do I use to release a module to CPAN for the first time? by davido.

Note: if performing point 2 (Generate your distribution framework) from davido's reference by hand (rather than using Module::Starter):

👁️🍾👍🦟

Replies are listed 'Best First'.
Re^2: CR/LF in bin
by dk (Chaplain) on May 10, 2024 at 08:23 UTC
    Yes if a distro is rolled on unix so no problem on windows, but not vice versa, apparently. I was greatly confused because if one makes a pure-perl module without magic or compilers involved, one can reasonably expect that windows distro-rolling is very smooth. And this problem was very basic, that's why my confusion.

    Anyway you might want to add to your tutorial how to package bin/ scripts, either use #!perl or nothing at all, but not #!something-else or be prepared to be bitten.

Re^2: CR/LF in bin
by etj (Priest) on May 11, 2024 at 11:24 UTC
    I believe the "toolchain" modules are pretty careful about being able to produce distros on Windows that work everywhere. If one can make an example of that not being true (which isn't the result of pilot error), then say so here.
      Yes here you go: CRLF-0.01.tar.gz

      $ tar xzf CRLF-0.01.tar.gz $ cd CRLF-0.01 $ perl Makefile.PL $ sudo make install $ rehash $ crlf /usr/bin/env: ‘perl\r’: No such file or directory
        What would be needed here is not a broken set of files, but the steps from the start that produced the broken set of files. It's the fileset-producing code/setup that's possibly at fault, and can be fixed. The broken set of files probably cannot, and in any case that wouldn't scale.