diff options
author | Karen Etheridge <ether@cpan.org> | 2015-12-28 15:58:39 -0800 |
---|---|---|
committer | Karen Etheridge <ether@cpan.org> | 2015-12-28 16:00:44 -0800 |
commit | 878a2a66722d9c8b1152d8197e2721a0643bfd78 (patch) | |
tree | e48acad2cd5bbe697c87bc9484eb617e3a7ad817 /lib/URI | |
parent | bb54ec53121c3bacfe5ea3be6c088e5c60844307 (diff) | |
download | uri-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.pm | 3 |
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"}; } } |