I'm trying to retrieve cookie data globally but I'm having problems recalling it in another script.
-Foo.pm-use base 'TheLib::Foo'; sub cookie1 : Runmode { $cgi_query = new CGI; $cookie1 = $cgi_query->cookie('sessioninfo'); { our $cookie1; print $cookie1;}} sub cookie2 : Runmode { $cgi_query = new CGI; $cookie2 = $cgi_query->cookie('visitcount'); { our $cookie2; print $cookie2;}} 1;
Which should I use at this point in the script to recall the cookie data?use HTTP::Template; sub my_infosheet { my $self = shift; my $template = $self->load_tmpl('my_infosheet'); (undef, my $info) = split(/\//, $ENV{'PATH_INFO'});
1. $cookie1 = $cookie1->cookie('sessioninfo')
$cookie2 = $cookie2->cookie('visitcount')
2. $cookie1 = our $cookie1->cookie('sessioninfo')
$cookie2 = our $cookie2->cookie('visitcount')
Thanks in advance.$template->param(COOKIE1 => $cookie1); $template->param(COOKIE2 => $cookie2); return $template->output; }
In reply to Making & Recalling Globals by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |