Skip Menu |

This queue is for tickets about the PadWalker CPAN distribution.

Report information
The Basics
Id: 4547
Status: resolved
Priority: 0/
Queue: PadWalker

People
Owner: Nobody in particular
Requestors: ericp [...] activestate.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.10
Fixed in: 0.11



Subject: peek_my pulls in outer lexicals and package vars
----------- SYSTEM INFO ----------- perl $ perl -V Summary of my perl5 (revision 5 version 8 subversion 1) configuration: Platform: osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread uname='' config_args='undef' hint=recommended, useposix=true, d_sigaction=undef usethreads=undef use5005threads=undef useithreads=define usemultiplicity=def ine useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef ... Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL_IMPLICIT_ CONTEXT PERL_IMPLICIT_SYS Locally applied patches: ActivePerl Build 807 Built under MSWin32 Compiled at Oct 29 2003 19:31:41 %ENV: PERLDOC_PAGER="less" @INC: c:/Perl/lib c:/Perl/site/lib . ----------- EXPLANATION ----------- I'm trying to get the lexicals one level up, but I also get the lexicals at the top-level. top-level 'my' variables keep their values, top-level 'our' ones don't. I'm going to have a look at the .xs to see if I can find something, but I'd appreciate a quick patch, or getting steered the right way. I notice this problem with the new 'y' command in perl5db as well. Thanks, Eric Here's the code that repros: ================== 8-< ========================== #!/usr/bin/env perl # # Show how upper variables seek into the stack-frame being investigated use strict; use PadWalker; use Data::Dumper; sub f2 { my $h = PadWalker::peek_my(1); print Dumper $h; } our @garray = qw(these values will be dropped but the var shouldnt show); my $topLevelValue = "this gets pulled down (incorrectly)"; $Fish::Bait = "this doesn't show up"; $main::otherVar = "does this?"; sub f1 { my $scalar = "this also shows up"; my @array = qw(these values will show up); &f2; } sub f0a { my $f0a_var = "this doesn't get pulled down (correctly)"; &f1; } f0a;
Date: Tue, 2 Dec 2003 17:36:56 -0800
From: Eric Promislow <ericp [...] ActiveState.com>
To: PadWalker <bug-PadWalker [...] rt.cpan.org>
Subject: Re: [cpan #4547] AutoReply: peek_my pulls in outer lexicals and package vars
RT-Send-Cc:
Afterwards, I read the tests, ran some tests on my own, and realize that I misunderstood the scope of lexicals. Sorry about that. So seeing the outer-level lexicals makes sense. But why do the 'our' variables lose their values? That's the only problem I have now. Thanks, Eric Promislow