in reply to hash name as a variable?

Your regex test
$DB_name =~ /[ISWLIVE ISWTEST ISWTEACH]/

should really be
$DB_name =~ /(ISWLIVE|ISWTEST|ISWTEACH)/

And then later...
each %$DB_name
I would create a reference to hash with:
$HREF = eval "\\\%$DB_name"; ... if ($HREF->{key} ...)

Replies are listed 'Best First'.
Re^2: hash name as a variable?
by samtregar (Abbot) on Sep 15, 2004 at 20:54 UTC
       $HREF = eval "\\\%$DB_name";

    Ouch. Please don't do that! And if you do, please check $@ afterwards since eval will trap fatal errors silently.

    -sam

      Thanks - I think you just helped me solve a different problem.
      Checking $@ showed where my script was bombing.