http://qs1969.pair.com?node_id=932761


in reply to Re: How to copy/cut and paste files without using modules ?
in thread How to copy/cut and paste files without using modules ?

The apparently arbitrary restrictions, are very far from being arbitrary.
There's nothing wrong with using modules (I use many myself),
but as a perl nub, an "I want X done" isn't my entire interest, but a more "how does it work" wondering,
both for theoretical and practical purposes.

Also the more fundamental the code is, the greater its implementation potential is,
the less likely it is to surprise the user (by run/intent errors), and the easier it is to be customize to the exact desired purpose for which it is required.

A less common reason to avoid modules (I faced) is when planning to convert the pl file to something else (like exe) once it's done,
but your converter can't handle modules correctly.

Generally when writing a long and complicated program, a module can be a huge time (& headache) saver,
but whenever using a module can be avoided (with a reasonable cost), a diy is always my choice.

Replies are listed 'Best First'.
Re^3: How to copy/cut and paste files without using modules ?
by CountZero (Bishop) on Oct 20, 2011 at 22:14 UTC
    Studying the source code of the modules is a great way of learning Perl.

    What "Perl-to-exe" converter are you talking about?

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

      I've tried:
      * perl2exe of indigoStar
      * the pp module
      * Cava Packager 2.0
      the last one seems to work with modules but it makes the exe huge in size for no obvious reason.
      I've actually asked about the perk2exe topic several times but never found an idle (& free) solution.
        Cava packager never worked for me, but perhaps I have to check the latest version again.

        pp works most of the time and has decent dependency checking, so it should pick up most of the modules you use.

        The huge size is due to the fact that these packagers do not turn your script into a pure exe-file at all, but package a minimal perl system into one file. So the resulting "exe" file is nothing else but your perl-system with the necessary modules and files included. When you start the "exe" it unpacks Perl in a temporary location and then that perl image runs your script.

        CountZero

        A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James