From: Vincent Pit Date: Mon, 3 Jan 2011 14:18:36 +0000 (+0100) Subject: Only load Carp on error X-Git-Tag: v0.10~7 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FLexical-Types.git;a=commitdiff_plain;h=0a0dd81f4af6ef04e4d11604bda2458a06a8577b Only load Carp on error --- diff --git a/lib/Lexical/Types.pm b/lib/Lexical/Types.pm index a8be1c4..026596f 100644 --- a/lib/Lexical/Types.pm +++ b/lib/Lexical/Types.pm @@ -5,8 +5,6 @@ use 5.008001; use strict; use warnings; -use Carp qw/croak/; - =head1 NAME Lexical::Types - Extend the semantics of typed lexicals. @@ -152,7 +150,8 @@ sub import { $as .= '::' if $as !~ /::$/; $hint = _tag(sub { $as . $_[0] }); } else { - croak "Invalid $r reference for 'as'"; + require Carp; + Carp::croak("Invalid $r reference for 'as'"); } } else { $hint = _tag(sub { @_ });