[Dancer-users] Using shared variables

Matthew Vickers mvickers at quispiam.com
Tue Jan 24 21:35:05 CET 2012


This is the Couch provider I am using in TouchBase3.

Gurunandan Bhat <gbhat at pobox.com> wrote:

>Hi,
>
>I was wondering about the issues using a shared variable in a single App.pm
>file. Here is what I mean:
>
>package App.pm
>
>my $var;
>
>// Initialize $var;
>.....
>
>Route1 => sub {
>
>// Modify $var
>...
>}
>
>Route2 => sub {
>
>// Use $var
>...
>}
>
>I first call Route1 then when I call Route 2, I expect that I will have the
>modified value (by Route 1) of $var in route 2. Unfortunately I get an
>undefined value for $var.
>
>Can someone more experienced than I, see if I am doing something obviously
>incorrect?
>
>Thank you
>
>Regards.
>
>_______________________________________________
>Dancer-users mailing list
>Dancer-users at perldancer.org
>http://www.backup-manager.org/cgi-bin/listinfo/dancer-users


More information about the Dancer-users mailing list