LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 01-30-2004, 10:11 AM   #1
wonderdog33
LQ Newbie
 
Registered: Nov 2003
Posts: 7

Rep: Reputation: 0
Question passing anonymous hash in CGI hidden field


hey,
i am trying to pass an anonymous hash to another cgi via a CGI hidden field. It doesn't seem to be working, and I was wondering if somebody could help me figure out what I'm doing wrong.

Here's the code:

snoop.cgi
debug("Before hidden pass Globals = ", Dumper($Gvars));
print $cgi->hidden( -name=>'Globals', -value=>%{$Gvars});

the code in the results.cgi is:
my $a={};
$a = $Cgi->param('Globals');
print Dumper($a);

the debug right before the hidden call shows that my hash is populated with everything I want in it, but when I dump $a on results.cgi, it just gives me the first key in the $Gvars hash.

any ideas? sorry if this isn't explained well.

thanks.
eric
 
Old 01-30-2004, 11:19 AM   #2
wonderdog33
LQ Newbie
 
Registered: Nov 2003
Posts: 7

Original Poster
Rep: Reputation: 0
Lightbulb the answer

in case anyone cares, the solution I came up with is as follows.

First, you can't pass complex data types to hidden. It must be a string. Going to CPAN yielded FreezeThaw which allows me to very quickly flatten my hash into a string, pass it, and than "thaw" it back into a hash on the other side. Sweet!

eric
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing hash of hashes as a parameter (Perl) rose_bud4201 Programming 8 04-21-2005 07:18 PM
passing passing variable in Java as reference djgerbavore Programming 3 11-10-2004 02:18 PM
files uploaded to anonymous ftp not readable by anonymous TheOneAndOnlySM Linux - Software 2 11-04-2004 07:42 AM
Exec CGI within a form field newuser455 General 0 09-12-2004 01:50 PM
http://www.burstnet.com/cgi-bin/ads/ad7954a.cgi/3980/RETURN-CODE rverlander LQ Suggestions & Feedback 1 06-07-2002 07:35 AM


All times are GMT -5. The time now is 10:29 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration