Hi,
That sounds pretty complicated to me. How about something like this?
sub hold_page {
# just use this to set hold
my $self=shift;
my $q = $self->query();
my $ord_num = $q->param("ordnum");
my $holdobj = Holds->new(OrdNum => $ord_num,
HoldReason => 'Manual');
if ( $holdobj->setHold() ){
return parse_header($self,$q->param('instance')) . "HOLD SET for $ord_num";
}
}
It cleans things up a lot, I use the Holds module for all things "Holds" related so it is not just for this one purpose. I also don't see the big problem with passing your query data around. That is what references are for. I do this kind of thing a lot for report queries also where each method is a query in the module and the module's queries share one display method. I guess the only other thing to look into is AUTOLOADER if you are getting into a situation where you have so much code you really would not want it all included at once. I just started learning about that. I see it used in a lot of cpan modules.
Thanks,
Eric
At 08:54 AM 4/8/2004, petersm wrote:
>John Day wrote:
>
>> I am starting a new project today which is going to be bigger, and I would
>like to break things up. But if I put the run modes into modules of their own
>how do they get access to the params and to the CGI query for example?
>>
>> I am reasonably new to OO-perl so I figure their is something I am missing
>here! Any advice appreciated.
>
>You will need to split them up into their own modules where each is a cgi-app
>with it's own instance script. C::A will take care of making sure you have a
>CGI object and access to the params. Each instance module will have it's own
>params. If you need site wide params, I would store those in a config file
>where each module could access them.
>
>Or, if you're a little more daring, you could check out the CheesePizza. It's
>a C::A which runs other C::A (plugins) and combines their output. It's useful
>for having separate modules to run things like the nav, a dynamic side bar,
>and a main content section all at the same time. cheesepizza.venzia.com
>
>Michael Peters
>Venzia
>
>---------------------------------------------------------------------
>Web Archive: http://www.mail-archive.com/suppressed/
> http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
>To unsubscribe, e-mail: suppressed
>For additional commands, e-mail: suppressed
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/suppressed/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.