Code

replace Regexp::Common with core Scalar::Util
authorMatthias Bethke <matthias.bethke@financial.com>
Wed, 10 Sep 2014 16:34:00 +0000 (18:34 +0200)
committerMatthias Bethke <matthias.bethke@financial.com>
Wed, 10 Sep 2014 16:34:00 +0000 (18:34 +0200)
bindings/perl/lib/Collectd/Unixsock.pm

index 2b3d8f5e5598f6fd6b782e90fbac0b340968ccdb..fdb2bbc0bc5e031eaf4e22e19ac8d0d926e8ffe7 100644 (file)
@@ -60,7 +60,7 @@ use warnings;
 
 use Carp (qw(cluck confess));
 use IO::Socket::UNIX;
-use Regexp::Common (qw(number));
+use Scalar::Util qw( looks_like_number );
 
 our $Debug = 0;
 
@@ -240,7 +240,7 @@ sub getval # {{{
                {
                        $ret->{$1} = undef;
                }
-               elsif ($entry =~ m/^(\w+)=($RE{num}{real})$/)
+               elsif ($entry =~ m/^(\w+)=(.*)$/ and looks_like_number($2))
                {
                        $ret->{$1} = 0.0 + $2;
                }