On Tue, Jun 26, 2001 at 04:32:35PM -0700, Philip Peeters wrote:
: When my script is called, I parse in some variables. I want to build
: a hash where the one variable will function as the a key of the hash
: and the other variables must be referenced by again a reference.. Confused?
: Me too. Example:
: 
:       %newdata = ();
:       $newdata{$TAG} = $co->param('account');
:       $newdata{$TAG}[0] = $co->param('initsearch');
:       $newdata{$TAG}[1] = $co->param('team');
:       $newdata{$TAG}[2] = $co->param('website');
: 
: should become:
: 
:       %newdata = ();
:       $newdata{$TAG} = $co->param('account');
:       $newdata{$TAG}[initsearch] = $co->param('initsearch');
:       $newdata{$TAG}[team] = $co->param('team');
:       $newdata{$TAG}[website] = $co->param('website');
: 
: But I can't seem to get this to work. Is this just a syntax problem,
: or is something more fundamentally wrong?

This is a syntax problem.  Try the following:

  $newdata{$TAG}{initsearch} = $co->param('initsearch');
  [...]

and access them with the same structure.

  Casey West

-- 
Shooting yourself in the foot with Postscript 
foot bullets 6 locate loadgun aim gun shoot showpage 

Reply via email to