develooper Front page | perl.perl5.porters | Postings from March 2000

Re: another dumpvar panic in RC2

Tom Christiansen
March 15, 2000 16:10
Re: another dumpvar panic in RC2
Message ID:
>On Tue, 14 Mar 2000 19:27:51 MST, Tom Christiansen wrote:
>>  DB<1> use POSIX
>>  DB<2> O UsageOnly
>>           UsageOnly = '1'
>>  DB<3> V POSIX
>>Not a GLOB reference at lib/ line 408, <IN> line 3.

>Looks like dumpvar doesn't know about these funny bits:

>    % perl -lwe 'sub foo; print $main::{foo}'
>    -1
>    % perl -lwe 'sub foo ($@); print $main::{foo}'
>    $@

Is this particularly useful?  It seems fragile.  One mention of
the typeglob without sneaking around Perl's back, and those
properties are gone.

% perl -lwe 'sub foo ($@); print $::{foo}; print *foo; print $::{foo}'  

If you disguise your intent from the compiler, you get by... once.

% perl -lwe 'sub foo; print $main::{foo}; eval q{print *foo}; print $main::{foo}'

% perl -lwe 'sub foo ($@); print $main::{foo}; eval q{print *foo}; print $main::{foo}'

And of course, no difference here:

% perl -lwe 'sub foo ($@); print $::{foo}; eval q{print *foo}; print $::{foo}'

Hm... I wonder whether the compiler could ever look into single-quoted,
compiled-time resolved strings on its eval q{...} stuff to learn more
about what's afoot?

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