On 07/01/2009 02:39:57 PM, Michael R Boudreau wrote:

> I have updated the code below so that the main Mason page passes the
> database handle to the subroutine, like so:
> 
>    my %categories = get_categories($dbh);
> 
> which works. But is there a better way?

What's wrong with that?  You could make "our $dbh" part of the module, 
and request it in the page via some function.  Then you wouldn't have 
to pass it back to any of the module routines.  But I don't think that 
would be better;* I think the way you have it now is probably the best 
idea.

MK

* unless you could keep the module loaded from one page request to the 
next, meaning you could have one handle for the entire session?  
AFAICT that is not possible tho.







------------------------------------------------------------------------------
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to