
david at kineticode
Feb 4, 2010, 3:34 PM
Post #8 of 9
(1834 views)
Permalink
|
|
Re: perl 5.10.1: not a glob reference at lib/Bric/Util/Burner/PHP.pm
[In reply to]
|
|
On Feb 4, 2010, at 2:44 PM, Alex Krohn wrote: > No, because the values of the symbol table are typeglobs not references. i.e.: > > alex [at] ale ~ $ perl -MData::Dumper -le 'print Dumper(\%{"main::"})' > $VAR1 = { > '/' => *{'::/'}, > 'stderr' => *::stderr, > 'SIG' => *::SIG, > 'utf8::' => *{'::utf8::'}, > <snip> > > The problem is in 5.10, we now have a mix of typeglobs and references: > > metrix [at] sitespee ~ $ perl -MData::Dumper -le 'use constant "test" => 1; print Dumper(\%{"main::"})' > $VAR1 = { > 'version::' => *{'::version::'}, > '/' => *{'::/'}, > 'stderr' => *::stderr, > 'test' => \1, > <snip> > > So we want to only look at typeglobs (so we check that a reference to > the $value is in fact a glob reference). Not sure if there is a better > way. > > Patch works in 5.8.8 as far as I can tell. Why wouldn't we want to copy over the references, too? Wouldn't your patch ignore the test constant? Basically, in the above example, all of "version::", "/", "stderr", and "test" need to be copied to the $vars hash reference so that they're available to PHP code. Best, David
|