$ServerStatus{ $Ip[$i] } = [ $Names[$i], "unknown" ];
You can also use map and one assignment instead of foreach:
%ServerStatus = map { $Ip[$i] => [ $Names[$i], "unknown"] } 0 .. $#Ip;
In reply to Re: Initializing a hash using a foreach loop
by gaal
in thread Initializing a hash using a foreach loop
by Paulster2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |