develooper Front page | perl.perl5.porters | Postings from July 2009

Re: Coring Variable::Magic / autodie fights with string eval in Perl5.10.x

Thread Previous | Thread Next
Paul Fenwick
July 5, 2009 01:57
Re: Coring Variable::Magic / autodie fights with string eval in Perl5.10.x
Message ID:
Hash: SHA1

G'day Vincent / All,

Vincent Pit wrote:

> * Fixing the bug in the core, and making autodie depend on
> B::Hooks::EndOfScope conditionnally on perl 5.10.0. This gets my vote.

I'm happy with %^H being preserved when a string eval is compiled; I expect
that 'use feature' pragma will break without it.  But I consider it a bug
that the contents of %^H are being stringified as soon as the string eval
has been compiled.

This would get my vote as well.

> * The Variable::Magic part of B::Hooks::EndOfScope can be replaced by
> tieing %^H to add it a destructor. The only drawback that I know of is
> that dieing at compile-time in the scope of the pragma can then generate
> some spurious "(in cleanup)" messages.

If it's convenient, could you provide an example?  I'm happy with the idea
that %^H can be tied.  I presume it could then trigger a destructor at the
end of lexical scope.  I guess that means that string eval actually copies
%^H into an entirely new structure, rather than increasing the ref-count of
the old one?

All the best,


- --
Paul Fenwick <> |
Director of Training                   | Ph:  +61 3 9354 6001
Perl Training Australia                | Fax: +61 3 9354 2681
Version: GnuPG v1.4.5 (MingW32)


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About