On Tuesday 14 March 2006 09:17 am, Jim Babcock wrote:

> I'm trying to follow the Mason books apprentice.perl.org example for login
> and session management and I'm having and issue with 'syshandler'.
>
> The book alleges that a file called 'syshandler' will get called first,
> even before autohandler  and even when autohandler is not called. It says
> that syshandler is the ideal place for setting up database handles and
> session cookies and such.
>
> I've tried mimicking what the book does and it doesn't seem to recognize
> it. Digging into the example from the book, it seems to hook it into the
> autohandler with an inherit. 

> Is the syshandler something they made up or is it a real component of
> mason? 

It isn't part of mason's inherit chain. It's a suggestion of one way of 
implementing things. Thus the need to explicitly inherit it in your base 
autohandler.

You can put all your db connectivity code in your base autohandler if you 
wish. The advantage of using a separate component is that you can make your 
autohandlers just about display, localise your session management in one 
place and wrap the "call_next" in an eval so you can do something useful if 
your autohandler throws an error. 

Alternatively you just write a perl module that wraps your session management 
for you and initialise that from your autohandler.

> Also, it seems like mason doesn't tell you when things fail, it tells you
> when you try to use them next time and that fails... is that a fair
> characterzation?

Not in my experience, usually it yells at me right away.


-- 
"...I was feared and worshipped across the mortal globe. And now I'm
 stuck at Sunnydale High. Mortal. A child. And I'm flunking math."
- Anya, Buffy the Vampire Slayer: Doppelgangland


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Mason-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to