in reply to Beginners question: assigning a variable as the name of a hash

What you're trying to do involves symbolic references, which is probably not a good idea. Anyway, it's this:

{ no strict 'refs'; %$name = ( $key => $keyvalue ); }
Note that I have switched off strict in a narrow enclosing scope; make sure you use it everywhere else.

You should definitely read this series.

the lowliest monk

  • Comment on Re: Beginners question: assigning a variable as the name of a hash
  • Download Code