Subject: | saftsumm 1.4 error 'Bareword "UUID::uuid" not allowed' in Log/Saftpresse/Plugin/Role/Tracking.pm (patch included) |
Date: | Sun, 15 May 2016 14:03:15 +0200 |
To: | bug-Log-Saftpresse [...] rt.cpan.org |
From: | Henrik Størner <henrik [...] hswn.dk> |
Hi,
the fresh release of 1.4 made me test this again, and I ran into this
problem:
# saftsumm </var/log/mail.info
could not load plugin Log::Saftpresse::Plugin::Postfix: Bareword
"UUID::uuid" not allowed while "strict subs" in use at
/usr/local/share/perl/5.20.2/Log/Saftpresse/Plugin/Role/Tracking.pm line 58.
Compilation failed in require at /usr/share/perl5/Module/Runtime.pm line
317.
Compilation failed in require at (eval 271) line 1.
Seems to be a mistake in how the UUID generate() function is called.
Changing Log/Saftpresse/Plugin/Role/Tracking.pm like this makes it work:
--- ./blib/lib/Log/Saftpresse/Plugin/Role/Tracking.pm 2016-05-15 11:13:33.000000000 +0200
+++ /usr/local/share/perl/5.20.2/Log/Saftpresse/Plugin/Role/Tracking.pm 2016-05-15 13:56:33.968259362 +0200
@@ -55,7 +55,8 @@
my ( $self, $stash, $notes ) = @_;
if( defined $stash->{'pid'} ) {
- my $id = UUID::uuid;
+ my $id;
+ UUID::generate($id);
$stash->{'tracking_id'} = $id;
$notes->set('tracking-pid-'.$stash->{'pid'}, $id);
$log->debug('generated tracking_id for pid-'.$stash->{'pid'});
Regards,
Henrik