From: Ciaran Mac An Iomaire Date: Wed, 7 Oct 2015 15:20:20 +0000 (-0700) Subject: Fix 'Modification of a read-only value attempted' error X-Git-Tag: collectd-5.5.1~58 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=159083153e62d7eabe46f8344439867130f1db80;p=collectd.git Fix 'Modification of a read-only value attempted' error --- diff --git a/bindings/perl/lib/Collectd/Unixsock.pm b/bindings/perl/lib/Collectd/Unixsock.pm index 5c6a5f9d..5e79d268 100644 --- a/bindings/perl/lib/Collectd/Unixsock.pm +++ b/bindings/perl/lib/Collectd/Unixsock.pm @@ -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;