projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
make _escape_argument() readonly-safe on older Perls
[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
..
69c755b
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.