in reply to Hash Table References?

It's good to see you using use strict;. However you only need it once in your script (although may be this is a couple of scripts combined to show the issue, in which case good work and ignore the comment).

I recommend that you return as soon as you find and deal with an error so you don't clutter the following code with redundant tests:

if ($paramno == 0) { print "\n\tNo parameters supplied - can't set up environment!\n" + ; return 0; }

However the real problem seems to be that you are creating an array containing a single element which is a reference to a hash in your lookup hash, where I suspect you really just want a reference thus:

my %DBhashlookup = ( "TEST" => \%TEST, "LIVE" => \%LIVE, "DEVLP" => \%DEVLP, ) ;

Making that change and running the code prints:

xxrctest S T A R T S KEY :: ADMIN_DIR VALUE :: /opt/bin2 xxrctest E N D S

DWIM is Perl's answer to Gödel

Replies are listed 'Best First'.
Re^2: Hash Table References?
by Ronnie (Scribe) on Jun 20, 2006 at 11:28 UTC
    Thanks that did the trick! I did wonder about the list context in the DBHASHLOOKUP table but not hard enough!! Once again many thanks.
    Ronnie