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} );
In reply to how to get name of hash value itself? by Binford
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |