Binford has asked for the wisdom of the Perl Monks concerning the following question:
using Getopts::Long I defined appropriate --option tags for these and now I want to define which ones were actually defined from the command line:my %addTargetServer = ( hostName => "", ipAddress => "" ); my %addTargetApplication = (targetServerHostName => $SERVER, targe +tApplicationType => "Generic", targetApplicationName => ""); my %addTargetAccount = ( targetServerHostName => $SERVER, targetAp +plicationName => $addTargetApplication{targetApplicationName}, target +ServerUserName => "", targetServerAccountPassword => "");
So now I have defined values in the key pair for a given HASh, but I need to know which cmdName (which in this case is the actual name of the HASH I defined i.e. 'addTargetApplication' or somesuch, but I can't for the life of me now figure out how to get the ACTUAL NAME of said hash for passing to the cmdName parameter in the vendors tool? Any ideas welcome...my $OPTIONS = GetOptions ( 'user=s' => \$USERNAME, 'passwd=s' => \$PASSWORD, 'server=s' => \$SERVER, 'hostname=s' => \$addTargetServer{hostName}, 'ipaddr=s' => \$addTargetServer{ipAddress}, 'apptype=s' => \$addTargetApplication{targetApplicationType}, 'appname=s' => \$addTargetApplication{targetApplicationName}, 'targetuser=s' => \$addTargetAccount{targetServerUserName}, 'targetpasswd=s' => \$addTargetAccount{targetServerAccountPass +word} );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how to get name of hash value itself?
by GrandFather (Saint) on Jan 23, 2007 at 22:15 UTC | |
|
Re: how to get name of hash value itself?
by ikegami (Patriarch) on Jan 23, 2007 at 21:36 UTC | |
|
Re: how to get name of hash value itself?
by starX (Chaplain) on Jan 23, 2007 at 21:43 UTC | |
by Binford (Sexton) on Jan 23, 2007 at 21:49 UTC | |
by starX (Chaplain) on Jan 23, 2007 at 23:41 UTC |