sub check_ip{ $F{ip} =~ s/\.0+([^0\.]+)/\.$1/g;
s/(^|\.)0+([^0\.]+|\d$)/$1$2/g;
foreach my $ip qw( 0.0.0.0 10.0.0.1 0010.1.2.30 020.000030.04.05 1.2.3.4 123.0.234.000){ $_ = $ip; s/(^|\.)0+([^0\.]+|\d$)/$1$2/g; print "$ip -> $_\n";}
sub check_ip{
$F{ip} =~ s/(^|\.)0+([^0\.]+|\d$)/$1$2/g;
$Fip=&trim($F{ip});
$Fip =~ s/(^|\.)0+([^0\.]+|\d$)/$1$2/g;
$F{ip} = join '.', map{ s/^0+(\d+)$/$1/; $_ } split /\./,$F{ip};
$Fip = join '.', map{ s/^0+(\d+)$/$1/; $_ } split /\./,$Fip;
$F{ip} = join '.', map{ int } split /\./,$F{ip};
print int(010);
s/(\d+)/int $1/ge;