long version--

okay, i'm confused, and this time it's not related to cookies.
it happens to be the same bloinkin' project, but this time it's
perl in general, that's got me baffled...

if have a subroutine that's defined, but it's not showing up as
defined. i used the *Symbol::Table::name{CODE} method myself and
sure enough, there's no CODE for the defined subroutine...

here's my debug snippet, in context--

###########################################

package My::Access;
# File: My/Access.pm

use strict;
use Apache::Constants qw(OK SERVER_ERROR);
use Apache::TicketTool;
use Apache::Log;

sub handler {
        my $r = shift;

        {
                no strict;
                # see camel book, page 282
                my $x = '';
                my @key = qw(
                        SCALAR ARRAY HASH
                        CODE FILEHANDLE
                );      # ignore GLOB, PACKAGE, NAME
                foreach my $item ( sort keys %My::Access:: ) {
                        my $descr = '';
                        foreach ( @key ) {
                                $descr .= "\t$_\n"
                                        if defined( *{$item}{$_} );
                        }
                        $x .= "$item\n$descr";
                }
                #$r->log->debug('My::Access::handler -- ' . join '/',grep 
*{$_}{CODE},sort keys %My::Access::);
                $r->log->debug("My::Access::handler -- \n$x");
        }

        if ( &needs_login($r) ) {

                if ( &logging_in($r) ) {

                        # currently trying to log in (user/password supplied)
                        $r->log->debug('My::Access::handler logging in 
(PerlHandler=>checkUser())');

                        my $h = $r->get_handlers( 'PerlHandler' );
                        unshift @{$h},\&checkUser ; # do &checkUser first
                        $r->set_handlers( PerlHandler => $h );

                } else {

                        # no ticket, no username -- so ask for login
                        $r->log->debug('My::Access::handler needs login 
(PerlHandler=>ask_login())');

                        $r->set_handlers( PerlHandler => [ \&ask_login ] );

                }
        }

        return OK;
}

sub logging_in {         #exists, but not as code?
...
}

sub needs_login {        #exists, but not as code?
...
}

sub ask_login {  #exists, but not as code?
...
}

sub make_login {        # doesn't exist at all???
...
}

sub checkUser {  #exists, but not as code?
...
}

sub make_welcome {      # doesn't exist at all???
...
}

sub need_cookies {      # doesn't exist at all???
...
}

1;

__END__


###########################################

and here's the resulting log output, which gives my mind a
temporal inversion tachyon matrix pulse*:

###########################################

[Thu May  3 00:09:04 2001] [notice] Apache/1.3.9 configured -- resuming normal 
operations
[Thu May  3 00:09:04 2001] [notice] suEXEC mechanism enabled (wrapper: 
/usr/lib/apache/suexec)
[Thu May  3 00:09:05 2001] [debug] /usr/local/lib/site_perl/My/Access.pm(52): [client 
208.33.90.85] My::Access::handler -- 
BEGIN
        SCALAR
OK
        SCALAR
        CODE
SERVER_ERROR
        SCALAR
        CODE
ask_login
        SCALAR
checkUser
        SCALAR
handler
        SCALAR
        CODE
logging_in
        SCALAR
needs_login
        SCALAR

[Thu May  3 00:09:05 2001] [error] Undefined subroutine &My::Access::needs_login 
called at /usr/local/lib/site_perl/My/Access.pm line 55.

where's make_login? make_welcome? need_cookies? hmm? aaugh!

if it was a non-terminated string or something of that nature 1)
the perl tokenizer would object and 2) it would then be "all are
screwy from line X on downward" which ain't the case (checkUser
seems to show up on the radar, and it comes after make_login,
which is nowhere to be seen).

###########################################

*star trek speak for "i have no *#$! idea what's happening here."

any wild-ass guesses would be appreciated.  (do i win a prize for
the most difficulty with a simple situation? or at least an
honorable mention for most belligerent refusal to move on and get
a life?)

###########################################

short version--

WTF?

-- 
[EMAIL PROTECTED]
http://sourceforge.net/projects/newbiedoc -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!

Reply via email to