if ($hosts->{$ip}) { print STDERR "Line $l: Warning: duplicate IP entry $ip, the last one will be used\n"; } #### 127.0.0.1 192.168.0.1 #### unless (defined $content) { open my($fh), "<", "/etc/hosts" or return [500, "Can't read /etc/hosts: $!"]; local $/; $content = <$fh>; }