G'day Ed,
Sorry for the delay, I've been rather busy at OSCON the whole week.
On Thu Jul 24 07:10:04 2008, EDAVIS wrote:
Show quoted text> Replacing the existing Fatal.pm causes trouble with packaged Perl
> distributions (RPMs and the like) because you have two packages claiming
> to own the same file. If the perl core is upgraded then Fatal.pm will
> get clobbered back again. Also from a cautious sysadmin's point of
> view, installing a new module is fairly safe but replacing a Perl core
> module is not.
Oh boy, where do I begin here? Unfortunately, this is a common headache
with all the dual-life modules out there on the CPAN. If you have
CGI.pm, then it comes bundled with Perl, but at the same time there are
updates released to the CPAN. Fatal (and hence autodie) is in the same
boat, although the decision to dual-life the module is much more recent.
The *ideal* situation for dual-life modules is they don't overwrite the
ones that come with core, they just install themselves in an earlier
position in @INC. That solves the double file problem nicely, but it's
always been traditional in Unix distros to check the Perl core modules
first.
Autodie should come as a standard core module in 5.8.9 and 5.10.1.
Show quoted text> Is it possible to have autodie install Fatal_for_autodie.pm instead
> and load that?
Show quoted text> If autodie interacts badly with the old version of Fatal, then check
> at load time that a program does not try to load both.
If autodie hadn't been approved for core distrubtion, then this is
exactly what I would have done. Unfortunately it results in a rather
sub-optimal solution. Without replacing some of Fatal's brains, autodie
can't easily tell the different between a user-sub and a Fatalised
built-in, and this can result in all sorts of strange interactions.
Having autodie overwrite (in memory) Fatal's guts works, but requires
specific loading orders for the modules, and from an end-user standpoint
these don't make much sense.
The current solution, while a pain for many common distros at the
moment, does result much much nicer code overall, no strange actions
from a distance, and less work in when 5.8.9 and 5.10.1 come out (where
autodie will be standard).
All the very best,
Paul