[cgiapp] Re: New Plugin: RunmodeDeclare
So, having had chance to have a play with it, I've run into a couple of problems. First, all subclasses need to 'use CGI::Application::Plugin::RunmodeDeclare' - it is not inherited from the superclass as are all other CAP's. Attempts to run against a subclass without the 'use CAP::RunmodeDeclare' causes a syntax error. Not a problem as such, but seems odd. It's not object oriented, so there's nothing to inherit. It's no different from use strict in that sense. I think Spiffy.pm allows this to happen, but I consider it a bit like voodoo, and don't necessarily recommend it. Mark -- . . . . . . . . . . . . . . . . . . . . . . . . . . . Mark StosbergPrincipal Developer [EMAIL PROTECTED] Summersault, LLC 765-939-9301 ext 202 database driven websites . . . . . http://www.summersault.com/ . . . . . . . . # CGI::Application community mailing list #### ## To unsubscribe, or change your message delivery options, ## ## visit: http://www.erlbaum.net/mailman/listinfo/cgiapp## #### ## Web archive: http://www.erlbaum.net/pipermail/cgiapp/ ## ## Wiki: http://cgiapp.erlbaum.net/ ## ####
[cgiapp] Re: New Plugin: RunmodeDeclare
I haven't had time to go and try it out [yet], but I'm curious. If I have something like this: startmode begin { Here } and I'm running my app under perl -d, can I set a breakpoint in the sub named begin, or is there magic happening that means that there's no actual sub named begin? From related docs: This totally breaks the debugger. Will have to wait on Devel::Declare fixes. http://search.cpan.org/~mschwern/Method-Signatures-0.11/lib/Method/Signatures.pm#Debugging Mark # CGI::Application community mailing list #### ## To unsubscribe, or change your message delivery options, ## ## visit: http://www.erlbaum.net/mailman/listinfo/cgiapp## #### ## Web archive: http://www.erlbaum.net/pipermail/cgiapp/ ## ## Wiki: http://cgiapp.erlbaum.net/ ## ####
Re: [cgiapp] Re: New Plugin: RunmodeDeclare
Rhesa Rozendaal wrote: As for the order in which arguments are fetched, I don't mind swapping $self-param and $q-param in the fallback order. I don't have a practical use case either way. I only use $self-param in this context when CA::Dispatch puts url components there. I thought you might sometimes want to override a url component with a form field, but I haven't seen that happen yet. This is actually a security problem with fetching in the order it does now. It's similar to the PHP bug where some config setting was turned on by default such that any query params automatically became real variables in your program. This was fine unless you used one of those variables for something else. This meant that anyone could craft a URL which would override a variable in your program. Nasty things can happen. -- Michael Peters Plus Three, LP # CGI::Application community mailing list #### ## To unsubscribe, or change your message delivery options, ## ## visit: http://www.erlbaum.net/mailman/listinfo/cgiapp## #### ## Web archive: http://www.erlbaum.net/pipermail/cgiapp/ ## ## Wiki: http://cgiapp.erlbaum.net/ ## ####
[cgiapp] Re: New Plugin: RunmodeDeclare
Mark Stosberg wrote: On Mon, 29 Sep 2008 00:18:02 +0100 Richard Jones [EMAIL PROTECTED] wrote: Mark Stosberg wrote: As Rhesa proposed, he has followed through and released a plugin to add the Devel::Declare / Method::Signatures magic to CGI::Application: http://search.cpan.org/perldoc?CGI::Application::Plugin::RunmodeDeclare Looks like an interesting alternative to CAP::AutoRunmode. One minor irritant is having to put 'runmode foo ($c:)' everywhere (only if using $c instead of $self of course). Might be useful to be able to declare use CGI::Application::Plugin::RunmodeDeclare(invocant = '$c'), or just use CAP::RunmodeDeclare qw($c). I agree with this sentiment. This brings back to life the discussion we were having on IRC the other day about $self vs $c. While I agree with the others about preferring $self, it doesn't hurt to have the option. The next release will allow you to say: use CGI::Application::Plugin::RunmodeDeclare invocant = '$c'; As for the order in which arguments are fetched, I don't mind swapping $self-param and $q-param in the fallback order. I don't have a practical use case either way. I only use $self-param in this context when CA::Dispatch puts url components there. I thought you might sometimes want to override a url component with a form field, but I haven't seen that happen yet. Method::Signatures now respects code attributes. I'm going to try and see if I can make it easier to reuse mschwern's code, so I don't have to copy/paste his stuff every time he changes something. I'd very much like to be able to use the same signature features. rhesa # CGI::Application community mailing list #### ## To unsubscribe, or change your message delivery options, ## ## visit: http://www.erlbaum.net/mailman/listinfo/cgiapp## #### ## Web archive: http://www.erlbaum.net/pipermail/cgiapp/ ## ## Wiki: http://cgiapp.erlbaum.net/ ## ####