PBP - lexicals

This commit is contained in:
Eric Miller
2008-07-09 02:36:03 +00:00
parent 5189871fde
commit a153913d29
2 changed files with 7 additions and 9 deletions

View File

@@ -104,12 +104,12 @@ sub model {
sub ip{
my $zyxel = shift;
my $ip_hash = $zyxel->ip_addresses();
my $ip;
my $found_ip;
foreach $ip (keys %{$ip_hash}) {
my $found_ip = $ip if (defined $ip and $ip =~ /\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/);
foreach my $ip (keys %{$ip_hash}) {
$found_ip = $ip if (defined $ip and $ip =~ /\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/);
}
return $ip;
return $found_ip;
}
1;
__END__