[monitoring-plugin-perl] Remove "scalar" call entirely

Tom Ryder git at monitoring-plugins.org
Fri Dec 22 11:50:07 CET 2017


 Module: monitoring-plugin-perl
 Branch: master
 Commit: da6fe80e84a20aaf405a89bd0203d9ce1abc097d
 Author: Tom Ryder <tom at sanctum.geek.nz>
   Date: Sat Dec 16 14:09:16 2017 +1300
    URL: https://www.monitoring-plugins.org/repositories/monitoring-plugin-perl/commit/?id=da6fe80

Remove "scalar" call entirely

Context with the lhs of the == operator forces this into scalar context
anyway, making this call redundant.

---

 lib/Monitoring/Plugin/Getopt.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/Monitoring/Plugin/Getopt.pm b/lib/Monitoring/Plugin/Getopt.pm
index 65c872f..c8033d0 100644
--- a/lib/Monitoring/Plugin/Getopt.pm
+++ b/lib/Monitoring/Plugin/Getopt.pm
@@ -392,7 +392,7 @@ sub arg
   );
 
   # Named args
-  if (exists $params{$_[0]} && scalar @_ % 2 == 0) {
+  if (exists $params{$_[0]} && @_ % 2 == 0) {
     %args = validate( @_, \%params );
   }
 



More information about the Commits mailing list