develooper Front page | perl.perl5.porters | Postings from October 1999

Re: deprecating SIGDIE

Thread Previous | Thread Next
From:
Ilya Zakharevich
Date:
October 4, 1999 14:47
Subject:
Re: deprecating SIGDIE
Message ID:
199910042146.RAA16516@monk.mps.ohio-state.edu
Nick Ing-Simmons writes:
> >> That fixes that. But still does not fix:
> >> 
> >>    eval { require $path };
> >>    if ($@ =~ /.../)
> >>     {
> >>     } 
> >
> >Fix *what*?  Why do you expect this to work at all?
> 
> Tk has for a long time tried loading "/some/path/Foo.al",
> after the manner of AutoLoader, and then if that fails "not found" 
> then tried to load "Foo.pm", if _that_ fails it assume Foo is 
> a delegated method.
> 
> Note that other fails (syntax errors, missing modules etc.) are 
> are just reported as-is.

> It works with the local $SIG{__DIE__} "fix".
> But if a SIGDIE handler mangles the message it does not look like 
> a "not found" error anymore and the script exits rather than using
> one of the fallbacks.

But this just cannot work!  Say, suppose we have loading modules from
a ZIP attached to the end of the executable.  So when require happens,
the executable is (re)opened (btw, is it possible on Win*) and zip
stream is read from it.  Suppose the executable got truncated
somewhere.  You will get something like "read from a closed/broken
filehandle" ;-) error.

I do not think this scheme of yours is applicable as a testcase for
possible behaviour of possible $SIG{__EXCEPTION__}.

Ilya

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About