[Catalyst] UNIVERSAL:require:ERROR
Jose Nyimi
josenyimi at skynet.be
Sun Mar 13 01:19:55 CET 2005
> -----Message d'origine-----
> De : catalyst-bounces at lists.rawmode.org [mailto:catalyst-
> bounces at lists.rawmode.org] De la part de Sebastian Riedel
> Envoyé : dimanche 13 mars 2005 01:14
> À : catalyst at lists.rawmode.org
> Objet : Re: [Catalyst] UNIVERSAL:require:ERROR
>
> Jose Nyimi wrote:
>
> > $engine->require;
> >
> > die qq/Couldn't load engine "$engine", "$@"/ if $@;
> >
> > I would suggest to replace $@ by $UNIVERSAL::require::ERROR
> >
> > To make it clear that you are using the UNIVERSAL::require module
here
> > and not the eval require $engine; approach.
> >
> > Im also wondering if $@ will contain the correct value since eval
> > is not in the scene ;)
> >
> UNIVERSAL::require is just a plain wrapper around eval/CORE::require,
> i'm lazy so i prefer $@. ;)
>
Note that $@ is being modified inside UNISERSAL::require
<paste>
# Check for module load failure.
if( $@ ) {
$@ =~ s/ at .*?\n$//;
$UNIVERSAL::require::ERROR = sprintf "$@ at %s line %d.\n",
(caller)[1,2];
return 0;
}
</paste>
;)
José.
More information about the Catalyst
mailing list