Bump, does anyone have objections to this? I can't see that it'll effect anyones code.
Lyle Mark Stosberg wrote: > Thanks for the idea, Lyle. > > I'd like to see what feedback others have before considering it further. > > Mark > > On Wed, 17 Mar 2010 23:06:00 +0000 > Lyle <[email protected]> wrote: > > >> Hi All, >> I've found myself overloading this method so that cgi-app runmodes can >> be chained objects, such as $c->obj->method(); >> I've updated the code* so that it shouldn't effect the way everyone is >> currently doing runmodes:- >> >> Basically, the lines:- >> my $body; >> eval { >> $body = $is_autoload ? $self->$rmeth($rm) : $self->$rmeth(); >> }; >> >> Are swapped for:- >> >> if(ref($rmeth) ne 'ARRAY'){ >> $rmeth=[$rmeth]; >> } >> my $body=$self; >> eval { >> for my $part(@$rmeth){ >> $body=$body->$part($is_autoload ? $rm : ()); >> } >> }; >> >> >> So if the runmode is passed in as an array reference then the methods >> are chained one after the other. Potentially this allows for any depth, >> so a runmode may refer to:- >> $c->obj1->obj2->obj3->method(), etc, where objX are just methods that >> return objects. >> >> Rather than just submitting a patch direct to Mark, I thought I'd post >> it here to check that this wouldn't create any problems for anyone. >> > > > ##### 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/ ## ## ## ################################################################
