ALT Linux repos
S: | 5.34.1-alt1 |
5.0: | 5.8.9-alt2 |
4.1: | 5.8.8-alt19.M41.1 |
4.0: | 5.8.8-alt14 |
+updates: | 5.8.8-alt14 |
3.0: | 5.8.7-alt2 |
Group :: Development/Perl
RPM: perl
Main Changelog Spec Patches Sources Download Gear Bugs and FR Repocop
Patch: perl-5.32.1-alt-at-Storable-no-early-dep-on-Log-Agent.patch
Download
Download
diff --git a/dist/Storable/Storable.pm b/dist/Storable/Storable.pm
index 1a750f1ba5..d5941baa58 100644
--- a/dist/Storable/Storable.pm
+++ b/dist/Storable/Storable.pm
@@ -41,39 +41,24 @@ $recursion_limit_hash = 256
use Carp;
-BEGIN {
- if (eval {
- local $SIG{__DIE__};
- local @INC = @INC;
- pop @INC if $INC[-1] eq '.';
- require Log::Agent;
- 1;
- }) {
- Log::Agent->import;
- }
- #
- # Use of Log::Agent is optional. If it hasn't imported these subs then
- # provide a fallback implementation.
- #
- unless ($Storable::{logcroak} && *{$Storable::{logcroak}}{CODE}) {
- *logcroak = \&Carp::croak;
- }
- else {
- # Log::Agent's logcroak always adds a newline to the error it is
- # given. This breaks refs getting thrown. We can just discard what
- # it throws (but keep whatever logging it does) and throw the original
- # args.
- no warnings 'redefine';
- my $logcroak = \&logcroak;
- *logcroak = sub {
- my @args = @_;
- eval { &$logcroak };
- Carp::croak(@args);
- };
- }
- unless ($Storable::{logcarp} && *{$Storable::{logcarp}}{CODE}) {
- *logcarp = \&Carp::carp;
- }
+sub logcroak {
+ goto &Log::Agent::logcroak
+ if do {
+ local ($@, $!, $SIG{__DIE__});
+ eval { require Log::Agent };
+ exists &Log::Agent::logcroak;
+ };
+ goto &Carp::croak;
+}
+
+sub logcarp {
+ goto &Log::Agent::logcarp
+ if do {
+ local ($@, $!, $SIG{__DIE__});
+ eval { require Log::Agent };
+ exists &Log::Agent::logcarp;
+ };
+ goto &Carp::carp;
}
#