On Thu, Oct 30, 2003 at 11:53:18AM -0800, Stas Bekman wrote:
> Autrijus Tang wrote:
> >If you use "if" or "open" or any other module names that also happen to
> >be keyword names in PREREQ_PM, then MM will fail
> >to detect anything.
> >
> >The patch below fixes that.
> >
> >Thanks,
> >/Autrijus/
> >
> >--- MakeMaker.pm.orig        Thu Oct 30 19:49:43 2003
> >+++ MakeMaker.pm     Thu Oct 30 19:52:12 2003
> >@@ -381,7 +381,9 @@
> >     foreach my $prereq (sort keys %{$self->{PREREQ_PM}}) {
> >         # 5.8.0 has a bug with require Foo::Bar alone in an eval, so an
> >         # extra statement is a workaround.
> >-        eval "require $prereq; 0";
> >+        my $file = "$prereq.pm";
> >+        $file =~ s{::}{/}g;
> >+        eval { require $file; 0 };
> 
> I've heard several times that 'eval { require $foo }' has problems with 
> older perls, that's why you keep on seeing eval "require $foo".

I remember falling foul of one of these errors. IIRC adding or removing a
semi-colon triggered/cleared that one.

$ grep require Changes* | grep eval
Changes5.002:NETaa14448: caller could dump core when used within an eval or require
Changes5.004:     Title:  "after an eval-ed bad require, requiring a string ref 
SEGVs", #F082
Changes5.004:     Title:  "Fix seg fault on eval/require and syntax errors", #F081
Changes5.005:        Log: Title:  "after an eval-ed bad require, requiring a string 
ref SEGVs", #F082
Changes5.005:        Log: Title:  "Fix seg fault on eval/require and syntax errors", 
#F081
Changes5.005:             Subject: Re: after an eval-ed bad require, requiring a 
string ref gives a SEGV 
Changes5.005:             Subject: Re: evals and requires make seg-fault with bad 
require file 
Changes5.8:             extended to all subsequent eval""s or requires
Changes5.8.1:     !> t/comp/require.t t/op/eval.t t/op/tie.t

I think that they were all fixed by 1998.

Nicholas Clark

Reply via email to