Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Thank you to perrin and to the Anonymous Monk, as well:

# perl -e 'use My::Module::Account qw(_GenerateAccountSummary); _Gener +ateAccountSummary();' Undefined subroutine &main::_GenerateAccountSummary called at -e line +1. # perl -e 'use My::Module::Account qw(_GenerateAccountSummary); My::Mo +dule::_GenerateAccountSummary();' Undefined subroutine &My::Module::_GenerateAccountSummary called at -e + line 1.
As for the advice from the anonymous monk, I was ready to dismiss the idea that I had typos in my code because this aspect of the code was working fine before the Etch-Lenny dist-upgrade and before installing fastcgi. However . . .

DEBUG: What the symbol table says about My::Module:: -- . . . 'log' => *My::Module::log, 'import' => *My::Module::import, . . .
Which is rather confusing because there is no ->import() method in either my base class, not in any of the custom modules it loads which I have written (at least if my grep pipe is to be believed). There is a ->new(), ->log(), ->_show_login_form(), ->_log_out() and a couple of others which are shown by Dumper(My::Module::).

Where might that ::import() be coming from if not from Exporter? And how is it I would figure that out?

So I rewrote my debug code like so:

{ $ENV{PATH} = "/bin"; foreach my $module (keys %INC){ my $result = `grep '^sub import' $INC{$module}`; if ($result){ print STDERR "The module: $module includes: \n$result \n"; } if($module =~ m/Account/){ print STDERR "The next module is: $module \n"; print STDERR `grep _GenerateAccountSummary $INC{$module}`; print STDERR "\n\n"; } } }
yielding the following output:

The module: CGI/Session.pm includes: sub import { The module: MIME/Types.pm includes: sub import_mime_types($) The module: SOAP/Lite/Utils.pm includes: sub import { The module: Exporter.pm includes: sub import { The module: subs.pm includes: sub import { The module: warnings/register.pm includes: sub import The next module is: My/Module/Account.pm our @EXPORT = qw( . . . _GenerateAccountSummary . . . ); our %EXPORT_TAGS = ( all => [qw( . . . _GenerateAccountSummary . . . +)] ); sub _GenerateAccountSummary { The module: bytes.pm includes: sub import { The module: vars.pm includes: sub import { The module: strict.pm includes: sub import { The module: AutoLoader.pm includes: sub import { The module: lib.pm includes: sub import { The module: re.pm includes: sub import { The module: Business/PayPal/API.pm includes: sub import { The module: warnings.pm includes: sub import The module: Devel/Trace.pm includes: sub import { The module: UNIVERSAL.pm includes: sub import { The module: /usr/local/share/perl/5.10.0/auto/Config/Simple/autosplit. +ix includes: sub import_names ; sub import_from ; The module: diagnostics.pm includes: sub import { The module: SOAP/Lite.pm includes: sub import { sub import { sub import { The module: version.pm includes: sub import { The module: Config/Simple.pm includes: sub import { sub import_names { sub import_from { The module: base.pm includes: sub import { The module: Config.pm includes: sub import { The module: integer.pm includes: sub import { The module: IO.pm includes: sub import { The module: FileHandle.pm includes: sub import { The module: constant.pm includes: sub import { The module: overload.pm includes: sub import { The module: CGI.pm includes: sub import { sub import_names {
So perhaps a third or more of the modules in %INC sport an ->import() method. Are they stomping on each other? And if so, how would I make them stop that and play nice?

-- Hugh

if( $lal && $lol ) { $life++; }

In reply to Re^5: fastcgi broke my Exports by hesco
in thread fastcgi did NOT break my Exports, issue now resolved by hesco

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-03-28 17:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found