summaryrefslogtreecommitdiff
path: root/ext/Sys/Syslog/Syslog.pm
diff options
context:
space:
mode:
Diffstat (limited to 'ext/Sys/Syslog/Syslog.pm')
-rw-r--r--ext/Sys/Syslog/Syslog.pm12
1 files changed, 7 insertions, 5 deletions
diff --git a/ext/Sys/Syslog/Syslog.pm b/ext/Sys/Syslog/Syslog.pm
index 9c05dcd1f5..eabf7b4dac 100644
--- a/ext/Sys/Syslog/Syslog.pm
+++ b/ext/Sys/Syslog/Syslog.pm
@@ -7,7 +7,7 @@ use Carp;
@ISA = qw(Exporter DynaLoader);
@EXPORT = qw(openlog closelog setlogmask syslog);
@EXPORT_OK = qw(setlogsock);
-$VERSION = '0.01';
+$VERSION = '0.02';
use Socket;
use Sys::Hostname;
@@ -119,6 +119,8 @@ E<lt>F<Tim.Bunce@ig.co.uk>E<gt> and the perl5-porters mailing list.
Dependency on F<syslog.ph> replaced with XS code by Tom Hughes
E<lt>F<tom@compton.nu>E<gt>.
+Code for constant()s regenerated by Nicholas Clark E<lt>nick@ccl4.orgE<gt>.
+
=cut
sub AUTOLOAD {
@@ -128,10 +130,10 @@ sub AUTOLOAD {
my $constname;
our $AUTOLOAD;
($constname = $AUTOLOAD) =~ s/.*:://;
- croak "& not defined" if $constname eq 'constant';
- my $val = constant($constname);
- if ($! != 0) {
- croak "Your vendor has not defined Sys::Syslog macro $constname";
+ croak "&Sys::Syslog::constant not defined" if $constname eq 'constant';
+ my ($error, $val) = constant($constname);
+ if ($error) {
+ croak $error;
}
*$AUTOLOAD = sub { $val };
goto &$AUTOLOAD;