in reply to Re: random undefined sub error
in thread random undefined sub error

> Is it really loaded by the script?

Well, according to his code, importer is never called since he explicitly uses empty lists after use ...

> > use gitadm_shell_commands();

Cheers Rolf

( addicted to the Perl Programming Language)

Replies are listed 'Best First'.
Re^3: random undefined sub error
by choroba (Cardinal) on Apr 10, 2013 at 14:20 UTC
    importer is never called
    It depends on how far the modules follow the common practices (look at their names). Try:

    script.pl:

    #!/usr/bin/perl use warnings; use strict; use Ugly (); puke('Where does it come from?');

    Ugly.pm:

    package Ugly; use warnings; use strict; my $package = (caller)[0]; sub puke { warn @_; } { no strict 'refs'; *{$package . '::puke'} = \&puke; } __PACKAGE__
    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
      Sure, I deliberately decided to ignore those dirty possibility. =)

      There are to many ways to pollute the namespace to be listed, at the end the OP should clarify how his code works.

      From the sparse information provided, we can't tell much.

      And he is redefining a sub with the same name, so I suppose nothing should be imported.

      Cheers Rolf

      ( addicted to the Perl Programming Language)