perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoffrey Young <gyo...@laserlink.net>
Subject RE: Apache::Symbol::undef_functions;
Date Thu, 10 Aug 2000 13:49:48 GMT


> -----Original Message-----
> From: Doug MacEachern [mailto:dougm@covalent.net]
> Sent: Wednesday, August 09, 2000 11:26 PM
> To: Geoffrey Young
> Cc: dev@perl.apache.org
> Subject: Re: Apache::Symbol::undef_functions;
> 
> 
> On Wed, 9 Aug 2000, Geoffrey Young wrote:
> 
> > Hi Doug...
> > 
> > sorry to bother you with this...  I'm looking into it, but 
> I thought just in
> > case you had any ideas off the top of your head :)
> 
> no worries, this is good stuff for dev@perl.apache.org, more 
> heads with
> stuff on the top ;)

cool - I thought this was for 2.0 devel stuff only. 

>  
> > I'm trying to replicate StatINC in Dispatch.pm and ran 
> across something
> > interesting.
> > 
> > a call to       
> > $class->Apache::Symbol::undef_functions;
> > 
> > makes my OO behave oddly - instead of returning the rc of 
> the method, it
> > returns the method name.
> > 
> > I know - "What?"
> > 
> > 
> > $method = "foo;
> > $rc = $class->$method();  # $rc=1
> > 
> > #now, undef_functions, delete and require, then
> > $rc = $class->$method();  # $rc="foo"
> > 
> > #just delete and require, no undef_functions
> > $rc = $class->$method();  # $rc=1, but warns "Subroutine 
> foo redefined"
> > 
> > weird, eh?
> 
> yeah, do you have a drop in test case?

well, not really :)  

I think I managed to work around it - I was use()ing Apache::Symbol at the
top of the script - changing to require() like StatINC made everything work
ok...

>  
> > I'm trying to trace through Apache::Symbol, but my C isn't 
> very strong,
> > so...
> 
> Apache::Symbol::undef is only different from the built-in 
> undef, in the
> way it avoids 'prototype mismatch' warnings.
>  if you have a 
> -DDEBUGGING
> libperl or libperld.a + PERL_DEBUG=1 (SUPPORT has hints), 
> local $^D = 8|16;  might shed some light.

well, it took me two days and a handfull of box restarts to get 5.6 on my
test box - I should have compiled with debugging from the start :(
anyway, I did use Devel::Peek which showed some really strange results where
$rc went from IV to PV to PVNV with IOK to PVNV with POK on successive
calls.  It was only returning OK that gave me problems and inconsistent
results - returning any other constant or 0 went fine...  stranger than
fiction.

>  
> > anyway, it's really kinda FYI, but just in case you were 
> working feverishly
> > on a mod_perl-2.0 counterpart ;)
> 
> i don't think Apache::Symbol will be in 2.0, because it was 
> written just
> to work around things that are fixed in Perl 5.004+.  but it 
> might have to
> stick around for backwards compat.

does that mean that there's a way to avoid the 'subroutine redefined' stuff
without Apache::Symbol in 5.6?


anyway, no need to worry about this any longer - I'm sure it's an isolated
incident.  thanks for your help...

--Geoff

> 

Mime
View raw message