From 159083153e62d7eabe46f8344439867130f1db80 Mon Sep 17 00:00:00 2001 From: Ciaran Mac An Iomaire Date: Wed, 7 Oct 2015 08:20:20 -0700 Subject: [PATCH] Fix 'Modification of a read-only value attempted' error --- bindings/perl/lib/Collectd/Unixsock.pm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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; -- 2.30.2