Geoffrey Young wrote:
>>
>> if ($mtime > $Stat{$file}) {
>> delete $INC{$key};
>> # warn "Reloading $key\n";
>> if (my $symref = $UndefFields{$key}) {
>> # warn "undeffing fields\n";
>> no strict 'refs';
>> undef %{$symref};
>> }
>> no warnings FATAL => 'all';
>> require $key;
>> warn("Apache::Reload: process $$ reloading $key\n")
>> if $DEBUG;
>> }
>>
>
> as we discussed on p5p the other day, changing local $^W the way you did is
> not equivalent - specifically, it will not silence these warnings they way
> it does currently.
I don't think we should try to find an equivalent.
Let's look at what we want to achieve first:
- we don't want to get redefine warnigs
- we don't want to impose anything on the module that gets loaded, so if
we have FATAL => 'all', this shouldn't abort the request if a module
that gets reloaded spits some compile time warnings, unless it sets the
warnings setup by itself, but that's not our problem.
The two requirements that we have are satisfied by:
no warnings FATAL => 'all';
(for those who didn't see the thread on p5p, no warnings; doesn't cancel
the FATALITY and will be patched by Paul, in the meanwhile that's the
workaround suggested by chromatic.
>
> Paul's suggestion of "no warnings 'redefine';" back at the subroutine end
> seems unreasonable to me, but ok, that's how things work now. given
that, I
> don't see a reason for "no warnings FATAL => 'all';" here, since we
are now
> relying on the module author to define how warnings are thrown and not
> Apache::Reload.
>
> unless I'm totally misunderstanding things...
But that's exactly what it does: it sets a pristine environment for
reloading the module, without enforcing any warnings mode.
Of course if the original module that has pulled this module, had some
warnings set, you cannot reproduce the same environment because you
don't know who pulled the module in and under what warnings setup.
_____________________________________________________________________
Stas Bekman JAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide http://perl.apache.org/guide
mailto:[EMAIL PROTECTED] http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]