Can you help me correct the code snippet.
I want to list the server which is type eq xyz but not with namedservers.
our %SERVERS = (
"rajesh1" => {type => 'xyz', sha => 'ram'},
"rajesh2" => {type => 'xyz', sha => 'sita'},
"rajesh3" => {type => 'xyz', named => ["raa"]},
"rajesh4" => {type => 'xxx', named => ["rajjaj"]},
);
while ( my $mServer = each(%SERVERS) )
{
if ("$SERVERS{$mServer}{type}" eq "xyz" && !"$SERVERS{$mServer}{named}" )
{
print "Name of the server is $mServer\n";
}
}
Expected result:
rajesh1 rajesh2
%SERVERS.$mServer, then later say$gServer. Pick one!$SERVERS{$mServer}{type}and$SERVERS{$mServer}{named}(once you’ve changedgServertomServer—you don’t need them."prod". How is that possible? Assuming you change their type to"prod"…"Name of the server is $mServer\n"(once you changegServertomServer). Changing that to just"$mServer\n", and …Hence:
Then: