in reply to Re: Creating a hash with the same name as the value of $hashref-{y}
in thread Creating a hash with the same name as the value of $hashref-{y}

The trouble is the values are coming from user input so I can't create a hash of hashes :(
  • Comment on Re: Re: Creating a hash with the same name as the value of $hashref-{y}

Replies are listed 'Best First'.
Re: Re: Re: Creating a hash with the same name as the value of $hashref-{y}
by runrig (Abbot) on Aug 16, 2001 at 00:23 UTC
    The trouble is the values are coming from user input so I can't create a hash of hashes.

    How is that a valid reason? Please don't use symbolic references without a good reason. Processing user input is an ever better reason NOT to use symbolic references. What if you end up trashing a perlvar? Create a HoH and don't live dangerously, here's a snippet that processes input:

    my %HoH; while (<DATA>) { my ($name, $key, $value) = split; $HoH{$name}{$key} = $value; } __DATA__ name key value a b c 1 2 3