Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Subclassing and CGI::Prototype

by merlyn (Sage)
on May 19, 2006 at 16:39 UTC ( #550537=note: print w/replies, xml ) Need Help??


in reply to Subclassing and CGI::Prototype

The problem is that there's also "instance" data in the class that gets the "activate"... in this case, the CGI object ends up in your "My_Zero" class, which is not in the inheritance path for One or Two, and so those pages don't have access to the CGI object.

I've thought about fixing that by forcing the CGI slot to always be located up in CGI::Prototype, but I have to think through that carefully to make sure that doesn't break some other assumption.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Replies are listed 'Best First'.
Re^2: Subclassing and CGI::Prototype
by tlm (Prior) on May 19, 2006 at 18:54 UTC

    Thanks.

    I've thought about fixing that by forcing the CGI slot to always be located up in CGI::Prototype, but I have to think through that carefully to make sure that doesn't break some other assumption.

    Hey, that's what unit tests are for! :)

    Anyway, in the meantime, I've added a few notes to the CGI::Prototype page at AnnoCPAN.

    the lowliest monk

      Try this patch. Change $self->reflect->addSlot to __PACKAGE__->reflect->addSlot in CGI/Prototype.pm in the initialize_CGI subroutine. I think that'll do it right. But I'm trying to think of how to have subclasses also be able to select where the CGI slot should be.

      -- Randal L. Schwartz, Perl hacker
      Be sure to read my standard disclaimer if this is a reply.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://550537]
help
Chatterbox?
[Corion]: jthebarg: There is the switch keyword if you want that, but maybe a dispatch table is closer.
[Corion]: If by "case" you meant "case-insensitive ", see fc, uc and lc and perlop on the /i flag ;)
Corion waves to virtualsue
[virtualsue]: I have made a post for the first time in ... years
[marto]: hey virtualsue!
Eily thought about Neko Case first, something might be wrong with my brain's wiring
[virtualsue]: I recommended dbic-migration even though I am having trouble with it this week. It might be my fault.
[ambrus]: wow! I haven't seen you here for a long time, virtualsue
virtualsue waves back
[Eily]: it would have been 2 years in 2 weeks actually. And welcome back virtualsue :)

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (14)
As of 2017-09-26 13:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (295 votes). Check out past polls.

    Notices?