From aaa7a44487510d26bc5775de29d27f8f53c887c7 Mon Sep 17 00:00:00 2001 From: Chris 'BinGOs' Williams Date: Sat, 15 Sep 2012 12:45:06 +0100 Subject: Update Sys-Syslog to CPAN version 0.32 [DELTA] 0.32 -- 2012.09.14 -- Sebastien Aperghis-Tramoni (SAPER) [BUGFIX] CPAN-RT#69040: Don't modify @_ in syslog(). [BUGFIX] Restore compatibility with Perl 5.6.0. [DOC] Perl-RT#81858: Fix some spelling errors (Peter J. Acklam). --- cpan/Sys-Syslog/Syslog.pm | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'cpan/Sys-Syslog/Syslog.pm') diff --git a/cpan/Sys-Syslog/Syslog.pm b/cpan/Sys-Syslog/Syslog.pm index 3d0c00dae7..deae4f3d6a 100644 --- a/cpan/Sys-Syslog/Syslog.pm +++ b/cpan/Sys-Syslog/Syslog.pm @@ -12,7 +12,7 @@ require 5.005; { no strict 'vars'; - $VERSION = '0.31'; + $VERSION = '0.32'; @ISA = qw< Exporter >; %EXPORT_TAGS = ( @@ -91,7 +91,7 @@ my $connected = 0; # flag to indicate if we're connected or not my $syslog_send; # coderef of the function used to send messages my $syslog_path = undef; # syslog path for "stream" and "unix" mechanisms my $syslog_xobj = undef; # if defined, holds the external object used to send messages -my $transmit_ok = 0; # flag to indicate if the last message was transmited +my $transmit_ok = 0; # flag to indicate if the last message was transmitted my $sock_port = undef; # socket port my $sock_timeout = 0; # socket timeout, see below my $current_proto = undef; # current mechanism used to transmit messages @@ -147,6 +147,14 @@ my @fallbackMethods = (); $sock_timeout = 0.001 if $^O =~ /darwin|gnukfreebsd/; + +# Perl 5.6.0's warnings.pm doesn't have warnings::warnif() +if (not defined &warnings::warnif) { + *warnings::warnif = sub { + goto &warnings::warn if warnings::enabled(__PACKAGE__) + } +} + # coderef for a nicer handling of errors my $err_sub = $options{nofatal} ? \&warnings::warnif : \&croak; @@ -329,8 +337,8 @@ sub setlogsock { $found = 1; } else { - warnings::warnif "setlogsock(): type='$sock_type': " - . $mechanism{$sock_type}{err_msg}; + warnings::warnif("setlogsock(): type='$sock_type': " + . $mechanism{$sock_type}{err_msg}); } } @@ -341,8 +349,7 @@ sub setlogsock { } sub syslog { - my $priority = shift; - my $mask = shift; + my ($priority, $mask, @args) = @_; my ($message, $buf); my (@words, $num, $numpri, $numfac, $sum); my $failed = undef; @@ -409,13 +416,13 @@ sub syslog { if ($mask =~ /%m/) { # escape percent signs for sprintf() - $error =~ s/%/%%/g if @_; + $error =~ s/%/%%/g if @args; # replace %m with $error, if preceded by an even number of percent signs $mask =~ s/(?