On Mon, 12 Jun 2006, Ogden wrote:
>
> MyApp::do_something($session{User}.get_id());
Are you a python or java programmer? ( . = concat, -> = deref )
package MyApp;
use Perl6::Export::Attrs;
sub do_something :Export( :DEFAULT ) {
do_stuff();
}
# in mason...
use MyApp;
do_something( $session{User}->get_id() );
There are 10,000 ways to do it in Perl. 80% of them are wrong.
Your way doesn't sound half bad.
You could, for example, write your own PerlAuthen/AuthzHandler
that processes before Mason, and either redirects to the login
if not authenticated or sets the user object into $r->pnotes...
The the autohandler puts it into your session. Or a pre-process
handler creates the session.
Whatever works.
Mark
_______________________________________________
Mason-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mason-users