Code

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 5c6a5f9d24c74179b8c2e3a878619198398bdc73..5e79d2682ecbb723ff094f1d12add49b15b72a76 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;