in reply to Re: fastcgi broke my Exports
in thread fastcgi did NOT break my Exports, issue now resolved

It is in symbol table, just not the way you expect
'My::' => *{'::My::'},
You want to look at  %My::Module::

Actually you want to grep @INC for _GenerateAccountSummary

Replies are listed 'Best First'.
Re^3: fastcgi broke my Exports
by hesco (Deacon) on Jul 15, 2009 at 15:07 UTC
    Dumping %My::Module:: yields:

    'Account::' => *{'My::Module::Account::'},
    which includes the supposedly missing method.

    Do you mean perhaps that I ought to grep %INC for that method name? @INC includes only directory names, an unlikely place for a method name to hide out.

    Imagining that, I added this to my index script:

    { $ENV{PATH} = "/bin"; foreach my $module (keys %INC){ if($module =~ m/Account/){ print STDERR "The next module is: $module \n"; print STDERR `grep _GenerateAccountSummary $INC{$module}`; print STDERR "\n\n"; } } }
    which yielded this output:

    The next module is: My/Module/Account.pm our @EXPORT = qw( . . . _GenerateAccountSummary . . . ); our %EXPORT_TAGS = ( all => [qw( . . . _GenerateAccountSummary . . . + )] ); sub _GenerateAccountSummary {
    That is the expected result. Still stumped here.

    -- Hugh

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

      Two things: can you show us the code where you call this, and why are you calling an exported function as a method? In general, methods are not something you would export.

      Also, try this:

      perl -e 'use My::Module::Account qw(_GenerateAccountSummary); _Generat +eAccountSummary();'
        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:

        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++; }
      That is the expected result. Still stumped here.

      Well, then the problem is your actual code, typos and such (your import routine isn't Exporter's import, wrong @EXPORT vars, wrong @ISA, you're calling method on wrong object ... typos).