Lori713 has asked for the wisdom of the Perl Monks concerning the following question:
my sid is: 004493c708b377edb6b73dbc5f6b9e61
my f_name is: CGI::Session::File=HASH(0x1b303c)
The second script opens up Excel nicely but gives me an error message. NOTE: $sid is passed via a hidden field in a form, so I'm expecting it to move to the next script via &call_vars which moves all my other variables. Another note: if $sid didn't exist, use strict would complain.
However, it shows my $sid as being "1" and not the big long alphanumeric string I would have expected. So, since it doesn't appear that the $sid is being passed, I'm not really expecting f_name to show up... but I also wasn't expecting a param error either...
my sid is: 1
Software error: Can't call method "param" without a package
or object reference at /local/.../SCRIPT2.pl line 12.
SCRIPT1 (which contains a button that calls SCRIPT2)
#!/usr/local/bin/perl5_8 use strict; use HTML::Template; use CGI::Session; use CGI ':standard'; my $CGI = CGI->new; &call_vars; #this calls via EXPORT all my variables like $sid $|=1; print $CGI->header; my $session = new CGI::Session("driver:File", undef, {Directory=>'/tmp +'}); $sid = $session->id(); $session->param('f_name', 'Sherzod'); #test variable #stuff that sets up template, generates @loop_data for template, etc. +snipped out $template->param(passdata => \@loop_data,); print $template->output(); print "<br>my sid is: $sid<br>"; print "<br>my f_name is: $session<br>";
SCRIPT2
Any clues for the clueless? TIA...#!/usr/local/bin/perl5_8 use strict; use HTML::Template; use CGI::Session; use CGI ':standard'; my $CGI = CGI->new; $|=1; print $CGI->header(-type => 'application/vnd.ms-excel'); print "<br>my sid is: $sid<br>"; my $f_name = $session->param('f_name'); #<=== Line 12 print "<br>my f_name is: $f_name<br>"; my $template = HTML::Template->new(filename => "SCRIPT2.tmp +l", associate => $CGI, loop_context_vars => 1, global_vars => 1, associate => $session );
Lori
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CGI::Session - trouble passing variables
by valdez (Monsignor) on Mar 01, 2004 at 22:13 UTC | |
by Lori713 (Pilgrim) on Mar 01, 2004 at 22:28 UTC | |
by antirice (Priest) on Mar 01, 2004 at 22:59 UTC | |
by Lori713 (Pilgrim) on Mar 02, 2004 at 12:19 UTC | |
|
Re: CGI::Session - trouble passing variables
by castaway (Parson) on Mar 01, 2004 at 21:46 UTC |