X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=bindings%2Fperl%2Flib%2FCollectd%2FUnixsock.pm;h=69c755b6a92996cd192b9845ea87c866dd51b741;hb=35795ab65c8a60d10581f307563034835252689a;hp=5c6a5f9d24c74179b8c2e3a878619198398bdc73;hpb=9817e7298bd6c364fa17347327af54adf048bd21;p=collectd.git diff --git a/bindings/perl/lib/Collectd/Unixsock.pm b/bindings/perl/lib/Collectd/Unixsock.pm index 5c6a5f9d..69c755b6 100644 --- a/bindings/perl/lib/Collectd/Unixsock.pm +++ b/bindings/perl/lib/Collectd/Unixsock.pm @@ -137,13 +137,13 @@ sub _parse_identifier 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.