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

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__
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^4: random undefined sub error
by LanX (Saint) on Apr 10, 2013 at 14:33 UTC
    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)