clone 648891 -1
retitle -1 munin-node: perl 5.14 deprecation warnings
severity -1 minor
tag -1 + patch
thanks

On Sat, 19 Nov 2011 00:09:13 +0100, gregor herrmann wrote:

> Well, almost, there are some deprecation warnings:
> 
> 2011/11/18-23:50:04 [1039] Error output from apache_processes:
> 2011/11/18-23:50:04 [1039]      Use of qw(...) as parentheses is deprecated 
> at /etc/munin/plugins/apache_processes line 164.
> 
> and the same from several other modules.
> 
> --> 
> http://search.cpan.org/~jesse/perl-5.14.0/pod/perldelta.pod#Use_of_qw%28...%29_as_parentheses
> 
> for $x qw(a b c) { ... }
> 
> -->
> 
> for $x (qw(a b c)) { ... }

I took a quick look at the source package and added the missing
parentheses where I found them --> attachment.
(apache_processes and memory are even tested :))

Cheers,
gregor


-- 
 .''`.   Homepage: http://info.comodo.priv.at/ - OpenPGP key ID: 0x8649AA06
 : :' :  Debian GNU/Linux user, admin, & developer - http://www.debian.org/
 `. `'   Member of VIBE!AT & SPI, fellow of Free Software Foundation Europe
   `-    NP: Van Morrison
diff --git a/plugins/node.d.linux/memory.in b/plugins/node.d.linux/memory.in
index ec3ea23..d4ec907 100755
--- a/plugins/node.d.linux/memory.in
+++ b/plugins/node.d.linux/memory.in
@@ -186,7 +186,7 @@ if ($ARGV[0] and $ARGV[0] eq "config") {
 	print "inact_clean.draw LINE1\n";
 	print "inact_clean.info Memory not currently used.\n";
     }
-    for my $field qw(apps buffers swap cached free slab swap_cache page_tables vmalloc_used committed mapped active active_anon active_cache inactive inact_dirty inact_laundry inact_clean) {
+    for my $field (qw(apps buffers swap cached free slab swap_cache page_tables vmalloc_used committed mapped active active_anon active_cache inactive inact_dirty inact_laundry inact_clean)) {
     	my ($warning, $critical) = get_thresholds($field);
 	my $total = $mems{MemTotal};
 	$total = $mems{SwapTotal} if($field eq "swap");
diff --git a/plugins/node.d/apache_processes.in b/plugins/node.d/apache_processes.in
index abe393a..939d875 100755
--- a/plugins/node.d/apache_processes.in
+++ b/plugins/node.d/apache_processes.in
@@ -161,7 +161,7 @@ if ( defined $ARGV[0] and $ARGV[0] eq "config" )
 	    print "free$port.colour ccff00\n";
 	}
 	foreach my $port (@PORTS) {
-		foreach my $type qw "busy idle" {
+		foreach my $type (qw(busy idle)) {
 			print_thresholds("$type$port");
 		}
 	}
diff --git a/plugins/node.d/users.in b/plugins/node.d/users.in
index 076f80f..f6b5fdd 100644
--- a/plugins/node.d/users.in
+++ b/plugins/node.d/users.in
@@ -79,7 +79,7 @@ if ( defined($ARGV[0])) {
 	print "other.label Other users\n";
 	print "other.info Users loged in by indeterminate method\n";
 	print "other.colour FF0000\n";
-	foreach my $field qw(tty pty pts X other) {
+	foreach my $field (qw(tty pty pts X other)) {
 		print_thresholds($field);
 	}
 	exit 0;

Attachment: signature.asc
Description: Digital signature

Reply via email to