summaryrefslogtreecommitdiff
path: root/lib/URI
diff options
context:
space:
mode:
authorKaren Etheridge <ether@cpan.org>2015-12-28 15:58:39 -0800
committerKaren Etheridge <ether@cpan.org>2015-12-28 16:00:44 -0800
commit878a2a66722d9c8b1152d8197e2721a0643bfd78 (patch)
treee48acad2cd5bbe697c87bc9484eb617e3a7ad817 /lib/URI
parentbb54ec53121c3bacfe5ea3be6c088e5c60844307 (diff)
downloaduri-878a2a66722d9c8b1152d8197e2721a0643bfd78.tar.gz
saving/restoring $@ is faster than localizing if done more than twice
(as done in Moo and Try::Tiny)
Diffstat (limited to 'lib/URI')
-rw-r--r--lib/URI/urn.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/URI/urn.pm b/lib/URI/urn.pm
index 5118979..4f0fbba 100644
--- a/lib/URI/urn.pm
+++ b/lib/URI/urn.pm
@@ -30,9 +30,10 @@ sub _init {
no strict 'refs';
unless (@{"${impclass}::ISA"}) {
# Try to load it
- local $@;
+ my $_old_error = $@;
eval "require $impclass";
die $@ if $@ && $@ !~ /Can\'t locate.*in \@INC/;
+ $@ = $old_error;
$impclass = "URI::urn" unless @{"${impclass}::ISA"};
}
}