Fix 'Modification of a read-only value attempted' error
authorCiaran Mac An Iomaire <ciomaire@adobe.com>
Wed, 7 Oct 2015 15:20:20 +0000 (08:20 -0700)
committerMarc Fournier <marc.fournier@camptocamp.com>
Wed, 14 Oct 2015 07:00:25 +0000 (09:00 +0200)
bindings/perl/lib/Collectd/Unixsock.pm

index 5c6a5f9..5e79d26 100644 (file)
@@ -262,10 +262,11 @@ sub getthreshold # {{{
     $self->_socket_chat($msg, sub {
             local $_ = shift;
             my $ret = shift;
-                   /^\s*([^:]+):\s*(.*)/ and do {
-                           $1 =~ s/\s*$//;
-                           $ret->{$1} = $2;
-                   };
+            my ( $key, $val );
+            ( $key, $val ) = /^\s*([^:]+):\s*(.*)/ and do {
+                  $key =~ s/\s*$//;
+                  $ret->{$key} = $val;
+            };
         }, $ret
     );
        return $ret;