Module: monitoring-plugin-perl Branch: master Commit: 6518f384cc20561ddc0df32414a714164dd2eb95 Author: Tom Ryder <t...@sanctum.geek.nz> Date: Sat Dec 16 13:34:38 2017 +1300 URL: https://www.monitoring-plugins.org/repositories/monitoring-plugin-perl/commit/?id=6518f38
Pass params validation by ref not copy Since Params::Validate::validate() doesn't seem to actually mess with this specification, may as well pass a reference rather than bother copying the whole thing. --- 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 b5a9ab4..65c872f 100644 --- a/lib/Monitoring/Plugin/Getopt.pm +++ b/lib/Monitoring/Plugin/Getopt.pm @@ -393,7 +393,7 @@ sub arg # Named args if (exists $params{$_[0]} && scalar @_ % 2 == 0) { - %args = validate( @_, { %params }); + %args = validate( @_, \%params ); } # Positional args