in reply to Re^2: random undefined sub error
in thread random undefined sub error
importer is never calledIt 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 |