http://www.perlmonks.org?node_id=1022366


in reply to Writing portable code

What do you hope to gain by sticking to having your code in just one file?

Replies are listed 'Best First'.
Re^2: Writing portable code
by McA (Priest) on Mar 08, 2013 at 09:49 UTC

    ...simple distribution of the script if you don't build full blown packages. Only a perl script.pl is needed when the script uses only core functionality. That is simple and lightweight. Am I wrong?

    Best regards
    McA

      This *could* be a reason in general, but is not so important in my particular case.

      If the "platform dependent" subs would form a logical unit, which deserves being factored out to a module, this is what I would do.

      -- 
      Ronald Fischer <ynnor@mm.st>
Re^2: Writing portable code
by rovf (Priest) on Mar 08, 2013 at 09:53 UTC

    Since the variations between Windows and Linux are logically part of the module, where they are used, it feels artificial to move them to a different module. That's why I would prefer to keep them together, if (only if!) I find an equally well solution which allows me to do so.

    -- 
    Ronald Fischer <ynnor@mm.st>