From 579fdad51ca7c1d306ba040954864216b0e07050 Mon Sep 17 00:00:00 2001 From: Gavin Carr Date: Wed, 4 Oct 2006 10:14:11 +0000 Subject: Tweak NP perldoc line widths; add missing chomp to NP::Functions. git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/Nagios-Plugin/trunk@1488 f882894a-f735-0410-b71e-b25c423dba1c --- lib/Nagios/Plugin/Functions.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/Nagios/Plugin') diff --git a/lib/Nagios/Plugin/Functions.pm b/lib/Nagios/Plugin/Functions.pm index e77bc4f..9cb7eb6 100644 --- a/lib/Nagios/Plugin/Functions.pm +++ b/lib/Nagios/Plugin/Functions.pm @@ -75,7 +75,12 @@ sub nagios_exit { # Set defaults $code = UNKNOWN unless defined $code && exists $STATUS_TEXT{$code}; $message = '' unless defined $message; - $message = join(' ', @$message) if ref $message eq 'ARRAY'; + if (ref $message && ref $message eq 'ARRAY') { + $message = join(' ', map { chomp; $_ } @$message); + } + else { + chomp $message; + } # Setup output my $output = "$STATUS_TEXT{$code}"; -- cgit v1.2.3-74-g34f1