projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'collectd-5.5'
[collectd.git]
/
bindings
/
perl
/
lib
/
Collectd
/
Unixsock.pm
diff --git
a/bindings/perl/lib/Collectd/Unixsock.pm
b/bindings/perl/lib/Collectd/Unixsock.pm
index
5c6a5f9
..
d927d13
100644
(file)
--- a/
bindings/perl/lib/Collectd/Unixsock.pm
+++ b/
bindings/perl/lib/Collectd/Unixsock.pm
@@
-137,13
+137,13
@@
sub _parse_identifier
sub _escape_argument
{
sub _escape_argument
{
-
local $_
= shift;
+
my $arg
= shift;
- return $
_ if
/^\w+$/;
+ return $
arg if $arg =~
/^\w+$/;
- s#\\#\\\\#g;
- s#"#\\"#g;
- return "\"$
_
\"";
+
$arg =~
s#\\#\\\\#g;
+
$arg =~
s#"#\\"#g;
+ return "\"$
arg
\"";
}
# Send a command on a socket, including any required argument escaping.
}
# Send a command on a socket, including any required argument escaping.
@@
-262,10
+262,11
@@
sub getthreshold # {{{
$self->_socket_chat($msg, sub {
local $_ = shift;
my $ret = shift;
$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;
}, $ret
);
return $ret;