Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Mojolicious global variable

by trippledubs (Deacon)
on Dec 13, 2018 at 20:19 UTC ( [id://1227221]=note: print w/replies, xml ) Need Help??


in reply to Mojolicious global variable

If you're using a variable across more than one route, but not globally across the whole application, it needs to go into a user cookie or saved per session. You currently have one global across the whole app.
# Validate $c->param('router') $c->session->{$router} = $c->param('router'); # In other routes my $router = $c->session->{$router} // $c->stash( router => $GLOBAL_DE +FAULT_ROUTER );

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1227221]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2024-04-26 03:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found