Gossamer Forum
Quote Reply
input as hash? how
I'm trying to figure out how to take the $IN and set it has a hash.

Example:

use Links qw/$IN/;

%hash = $IN->param{'*'} <- all the variables

Now I have seen something crazy like this:

%hash = %{&cgi_to_hash($IN)};

but you have to import tons of crazy modules for a crazy job, and I really don't understand it.


CGI.pm supports %hash = $IN->Vars; (I thought anyway!)

You would think it would be that simple, But this does not seem to work.

I need $IN->param{'name'} etc. to work also.

Any suggestions?

- Jonathan
Quote Reply
Re: [jdgamble] input as hash? how In reply to
Use my $hash = $IN->get_hash to return CGI input as a hash. Use $IN->param('foo') to get a particular value, and $IN->param(foo => 'bar') to set a value.

Adrian
Quote Reply
Re: [brewt] input as hash? how In reply to
Thanks. $IN->get_hash was exactly what I was looking for. I knew how to grab one variable, just not the entire hash.

- Jonathan