There are a few problems here. You are using %hash for 2 different things: a hash with key=site, value=ftp.siebel.com; a hashref with key={ftp.siebel.com}{ip_now} = 64.181.143.36 and {ip_new} = something other ip address.
Your loop structure complains that the hashref is missing when the key=site. Adding the following would get rid of the error, but only by filling in the void after line 39 above:
$hash{site} = $ftp_siebel_dns; $hash{site}{ip_now} = "x"; $hash{site}{ip_new} = "y";
A better way would be to change the structure to:
%HoH = ( $ftp_siebel_dns => { ip_now => $ftp_siebel_ip, ip_new => $ftp_siebel, }, );
That looks about the same, but you would not have any key called site.
In reply to Re: Problem with Hash when Using Strict
by Lhamo Latso
in thread Problem with Hash when Using Strict
by Dru
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |