On Wed, Nov 26, 2008 at 05:37:42PM +0900, Raymond Wan wrote:
> Do I have to do a:
>
> "use MyModule;"
>
> in every file? Is there a better alternative? I don't mind putting a
> PerlModule directive in my httpd.conf or a "use MyModule" in the
> handler, but I am not sure if that achieves what I would like and is the
> "correct way to do things".
Code in your components is run in the HTML::Mason::Commands package.
So, in your handler, you could do:
{
package HTML::Mason::Commands;
use MyModule; # imports a bunch of stuff
use Other::Module qw(some functions here);
# etc.
}
hdp.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Mason-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mason-users