S
shade
Hello all,
I'm a Perl newbie here and have a quick question regarding CGI.pm.
I have a CGI script that passes an array to another CGI script as
follows:
# sender.cgi
.... (snipped code)
my @fruit = ('apple','orange','pear');
print $q->startform( -action=>'receiver.cgi' ),
$q->submit( -name=>'Export Data' ),
$q->hidden( -name=>'xlfruit' value='@fruit' ),
$q->endform;
.... (snipped code)
# receiver.cgi
.... (snipped code)
my @fruit = param( 'xlfruit' );
print @fruit\n;
print @fruit[0]\n;
.... (snipped code)
The values of the fruit array pass through okay to the new CGI script
but come as a single list. I.e. the out of print @fruit[0] is the
whole line (apple orange pear) rather than just apple. It doesn't
look like the variable is still an array after the pass. Is this
normal or am I missing something?
Thanks for any help.
Tom
I'm a Perl newbie here and have a quick question regarding CGI.pm.
I have a CGI script that passes an array to another CGI script as
follows:
# sender.cgi
.... (snipped code)
my @fruit = ('apple','orange','pear');
print $q->startform( -action=>'receiver.cgi' ),
$q->submit( -name=>'Export Data' ),
$q->hidden( -name=>'xlfruit' value='@fruit' ),
$q->endform;
.... (snipped code)
# receiver.cgi
.... (snipped code)
my @fruit = param( 'xlfruit' );
print @fruit\n;
print @fruit[0]\n;
.... (snipped code)
The values of the fruit array pass through okay to the new CGI script
but come as a single list. I.e. the out of print @fruit[0] is the
whole line (apple orange pear) rather than just apple. It doesn't
look like the variable is still an array after the pass. Is this
normal or am I missing something?
Thanks for any help.
Tom