Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • When you're saying "perl -c Pippo.pm", you are compiling and running a package without a surrounding require, and then "use Pluto" works alright.

    Compare that with the output of "perl -c -e 'use Pippo'". It seems more well behaved (and does not emit warnings).

    $ perl -c -e 'use Pippo'
    $VAR1 = {
              'Pippo' => {
                           'Pippo.pm' => 'Pippo.pm'
                         }
            };
    $VAR1 = {
              'Pluto' => {
                           'Pluto.pm' => 'Pluto.pm',
                           'Pippo.pm' => 'Pippo.pm'
                         }
            };
    -e syntax OK
    In your example, you compile "Pippo.pm" which uses "Pluto.pm" which uses "Pippo.pm" (which does not take into account that Pippo.pm is being compiled). When "use Pluto" succeeds, the subroutines in Pippo.pm are redefined.
    • Actually, that's quite cute, though you don't need the -c anymore (it checks the syntax of the expression "use Pippo"). And it does clarify the difference between running a file and useing it.

      But it would be nice to be able to "perl -c" the file directly (as it's burned into my finger memory as well as my Vim configuration).

      Oh, I forgot to post the workaround I use:

      package Pippo;
      BEGIN { $INC{'Pippo.pm'} = $0}
      --

      osfameron