my $e = qr/[01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5]/;
my $match_ip = qr/($e)\.($e)\.($e)\.($e)/;
if ( $str =~ /^$match_ip$/ ){
print "$1,$2,$3,$4.\n";
}
my $e = qr/[01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5]/;
my $match_ip = qr/($e)\.($e)\.($e)\.($e)/;
if ( $str =~ /^$match_ip$/ ){
print "$1,$2,$3,$4.\n";
}