On Thu, May 03, 2001 at 08:52:38PM -0500, Ken Williams wrote:
> I can't follow this test case. Your previous message had a test case,
> but it was way too big. Can you whittle this down into the smallest
> possible program that demonstrates something you don't understand, and
> post that? My guess is that you'll figure out the problem in the
> process, but if not, post it here.
i found the culprit, but it's like finding out that a butterfly
burned down your house. i still don't see how it's possible.
when i distill it, of course, the problem vanishes. but see
below--
> By the way, I don't think you mean $My::Debacle::handler{CODE}. If you
> look closely, you'll see that it's just a regular hash entry. I think
> you mean *{$My::Debacle::{handler}}{CODE}. That's the CODE component of
> a symbol table entry.
right. whoops. boy, that stuff gets deep, quick.
> If you have "Effective Perl Programming", look on page 239.
eagle book, camel book, but no "shiny ball book". yet. :)
> I know this stuff is hard to spot when you've been banging your head
> against it for days. For that, I recommend "Zen and the Art of
> Motorcycle Maintenance".
a very good read, that.
> [EMAIL PROTECTED] (will trillich) wrote:
> >okay, here was the problem.
> >
> > package My::Debacle;
> >
> > sub search {
> > # ....
> > {
> > use CGI qw/:standard/;
> > my $form = join '',
> > map {
> > hidden(
> > -name => $_,
> > -value => $arg->{$_},
> > ) . "\n"
> > }
> > grep(
> > $arg->{$_} and ($_ ne 'd') and ($_ ne 'go')
as is, the functions that follow (top-level 'sub xyz {}') get
screwy. code disappears.
replace "and" with "&&" and all is well. boggles my mind.
> > , keys %$arg
> > )
> > ;
> > # ....
> > }
> > # ....
> > }
> >
> > sub this { # ...
> > }
> > sub that { # ...
> > }
> > sub something_else { # ...
> > }
> > sub whatever_the_hell { # ...
> > }
> > sub handler { # ...
> > }
with 'and' *{$My::Debacle::{handler}}{CODE} doesn't exist.
i've got a similar snag in a different module, now, where defined
subs are disappearing. but i can't trace it to a stray 'and'
here... must be something deeper?
--
[EMAIL PROTECTED]
http://sourceforge.net/projects/newbiedoc -- we need your brain!