List Info

Thread: Improve diagnostic for reloads of bad modules




Improve diagnostic for reloads of bad modules
user name
2007-09-18 10:41:30
    % cat F.pm
    package F;
    die "I don't compile";

    % cat reload.pl
    eval "use F";
    require F;

    % ./perl -w reload.pl
    Compilation failed in require at
/home/rick/perl/reload.pl line 2.

This error message is not very useful when line 1 is very
far away.
You'll be left scratching your head wondering why F didn't
compile since
it doesn't tell you.

The attached patch changes the error to

    Attempt to reload F.pm aborted.
    Compilation failed in require at
/home/rick/perl/reload.pl line 2.

Then at least you know that you need to find the place that
originally
required F and suppressed its errors.

-- 
Rick Delaney
rickbort.ca

  
Re: Improve diagnostic for reloads of bad modules
user name
2007-09-18 11:23:16
On Tue, Sep 18, 2007 at 11:41:30AM -0400, Rick Delaney
wrote:
> diff -pruN perl-current/pod/perldiag.pod
perl-current-dev/pod/perldiag.pod
> --- perl-current/pod/perldiag.pod	2007-09-08
18:37:50.000000000 -0400
> +++ perl-current-dev/pod/perldiag.pod	2007-09-18
00:26:50.000000000 -0400
>  -282,6 +282,12  invalid anytime, even before the end of 
>  literals or global values as arguments to the
"p" pack() template to
>  avoid this warning.
>  
> +=item Attempt to reload %s aborted.
> +
> +(F) You tried to load a file with C<use> or
C<require> that failed to
> +compile once already.  Perl will not try to compile
this file again
> +unless you delete in from %INC.  See
L<perlfunc/require> and L<perlvar/%INC>.
> +

Should that be "unless you delete it from %INC"?
(Or maybe "unless you delete its entry from
%INC".)

Ronald

Re: Improve diagnostic for reloads of bad modules
user name
2007-09-18 15:12:38
On Sep 18 2007, Ronald J Kimball wrote:
> > +=item Attempt to reload %s aborted.
> > +
> > +(F) You tried to load a file with C<use> or
C<require> that failed to
> > +compile once already.  Perl will not try to
compile this file again
> > +unless you delete in from %INC.  See
L<perlfunc/require> and L<perlvar/%INC>.
> > +
> 
> Should that be "unless you delete it from
%INC"?
> (Or maybe "unless you delete its entry from
%INC".)

I meant the first one but I like the second alternative
better.

-- 
Rick Delaney
rickbort.ca

Re: Improve diagnostic for reloads of bad modules
user name
2007-09-22 15:30:40
On Sep 18 2007, Rick Delaney wrote:
> On Sep 18 2007, Ronald J Kimball wrote:
> > Should that be "unless you delete it from
%INC"?
> > (Or maybe "unless you delete its entry from
%INC".)
> 
> I meant the first one but I like the second alternative
better.

Here's another patch if that makes things any easier.

-- 
Rick Delaney
rickbort.ca

  
Re: Improve diagnostic for reloads of bad modules
user name
2007-09-25 06:42:09
On 22/09/2007, Rick Delaney <rickbort.ca> wrote:
> On Sep 18 2007, Rick Delaney wrote:
> > On Sep 18 2007, Ronald J Kimball wrote:
> > > Should that be "unless you delete it
from %INC"?
> > > (Or maybe "unless you delete its entry
from %INC".)
> >
> > I meant the first one but I like the second
alternative better.
>
> Here's another patch if that makes things any easier.

Thanks, applied as #31965

[1-5]

about | contact  Other archives ( Real Estate discussion Medical topics )