view release on metacpan or search on metacpan
lib/Lexical/Persistence.pm view on Meta::CPAN
use strict;
our $VERSION = '1.020';
use Devel::LexAlias qw(lexalias);
use PadWalker qw(peek_sub);
=head2 new
Create a new lexical persistence object. This object will store one
or more persistent contexts. When called by this object, lexical
lib/Lexical/Persistence.pm view on Meta::CPAN
my $lp = Lexical::Persistence->new();
$lp->do('my $count = 0');
my $coderef = $lp->compile('print ++$count, "\\n"');
$lp->call($coderef) for 1..10;
do() inherits some limitations from PadWalker's peek_sub(). For
instance, it cannot alias lexicals within sub() definitions in the
supplied CODE string. However, Lexical::Persistence can do this with
careful use of eval() and some custom CODE preparation.
=cut
lib/Lexical/Persistence.pm view on Meta::CPAN
$self->set_context( arg => $old_context );
}
=head1 SEE ALSO
L<POE::Stage>, L<Devel::LexAlias>, L<PadWalker>,
L<Catalyst::Controller::BindLex>.
=head2 BUG TRACKER
https://rt.cpan.org/Dist/Display.html?Status=Active&Queue=Lexical-Persistence
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Lexical/Util.pm view on Meta::CPAN
=head1 DESCRIPTION
C<Lexical::Util> is a module containing some common routines used by modules
dealing with the lexical variables of routines other than their own. They are
taken from various sources, including L<PadWalker|PadWalker>,
L<Perl6::Binding|Perl6::Binding>, and L<Lexical::Alias|Lexical::Alias>. This
module is used in version 0.7 and greater of Perl6::Binding, as well as in the
L<Object::Variables|Object::Variables> and L<Sub::Declaration|Sub::Declaration>
packages, to prevent duplication of code.
lib/Lexical/Util.pm view on Meta::CPAN
=back
=head1 SEE ALSO
L<Perl6::Binding>, L<PadWalker|PadWalker>, L<Lexical::Alias|Lexical::Alias>
=head1 COPYRIGHT AND LICENSE
Copyright 2004 Kevin Michael Vail
view all matches for this distribution
view release on metacpan or search on metacpan
lib/List/Comprehensions.pm view on Meta::CPAN
use Carp;
# for comp2
use Alias qw(attr);
use Array::RefElem qw(av_push);
use PadWalker qw(peek_my);
require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw(comp1 comp2 P PF);
view all matches for this distribution
view release on metacpan or search on metacpan
#define ncmp(left,right) LMUncmp(aTHX_ left,right)
#define FUNC_NAME GvNAME(GvEGV(ST(items)))
/* shameless stolen from PadWalker */
#ifndef PadARRAY
typedef AV PADNAMELIST;
typedef SV PADNAME;
# if PERL_VERSION_LE(5,8,0)
typedef AV PADLIST;
view all matches for this distribution
view release on metacpan or search on metacpan
#define ncmp(left,right) LSUXSncmp(aTHX_ left,right)
#define FUNC_NAME GvNAME(GvEGV(ST(items)))
/* shameless stolen from PadWalker */
#ifndef PadARRAY
typedef AV PADNAMELIST;
typedef SV PADNAME;
# if PERL_VERSION < 8 || (PERL_VERSION == 8 && !PERL_SUBVERSION)
typedef AV PADLIST;
view all matches for this distribution
view release on metacpan or search on metacpan
WIP/blib/lib/Mildew/AST/Helpers.pm view on Meta::CPAN
}
use Exporter 'import';
our @EXPORT = qw(string reg integer call FETCH lookup capturize let fcall name_components empty_sig routine code move_CONTROL XXX trailing_return varname lookupf curlies named_and_positional dump lookup_package YYY wrap_in_block);
use Carp 'confess';
use Term::ANSIColor qw(:constants);
use PadWalker qw(peek_my);
use YAML::XS qw(Dump);
use utf8;
use strict;
sub YYY {
view all matches for this distribution
view release on metacpan or search on metacpan
0.004 2012-01-08 07:04:56 Europe/London
Require a version of Test::More providing new_ok.
0.003 2011-07-05 18:22:39 Europe/London
Check for PadWalker - without it, cycle tests fail
0.002 2011-07-05 07:15:51 Europe/London
Add missing dependency on parent.pm for tests
Rename event_stack to event_handlers since the original name was misleading (thanks mst)
Fix typo in synopsis
view all matches for this distribution
view release on metacpan or search on metacpan
"requires" : {
"Encode" : "0",
"File::Spec" : "0",
"IO::Handle" : "0",
"IPC::Open3" : "0",
"PadWalker" : "0",
"Pod::Wordlist" : "0",
"Test::CPAN::Changes" : "0.19",
"Test::CPAN::Meta" : "0",
"Test::CleanNamespaces" : "0.15",
"Test::EOL" : "0",
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Moops.pm view on Meta::CPAN
Will probably never be stable.
A lot of the modules that Moops is built on have problems. In particular,
L<Devel::CallParser> is broken on a lot of Perl versions, and
L<Parse::Keyword> has I<< fundamental errors in the way it handles closures >>
(which Moops works around using L<PadWalker>).
Moops will remain on CPAN for the foreseeable future and I'll continue
to accept patches that fix bugs, but don't expect any new features to
be added.
view all matches for this distribution
view release on metacpan or search on metacpan
"Module::CPANTS::Analyse" : "0.92",
"Module::Refresh" : "0",
"Moo" : "0",
"MooseX::MarkAsMethods" : "0",
"MooseX::NonMoose" : "0",
"PadWalker" : "0",
"Params::Coerce" : "0",
"Regexp::Common" : "0",
"SUPER" : "1.10",
"Specio" : "0.10",
"Test::CPAN::Changes" : "0.19",
view all matches for this distribution
view release on metacpan or search on metacpan
lib/MooseX/Compile/Compiler.pm view on Meta::CPAN
use Data::Dump qw(dump);
use Data::Visitor::Callback;
use Storable;
use B;
use B::Deparse;
use PadWalker;
use Class::Inspector;
our %compiled_classes;
use constant DEBUG => MooseX::Compile::Base::DEBUG();
lib/MooseX/Compile/Compiler.pm view on Meta::CPAN
my $body = $method->body;
my $body_str = $d->coderef2text($body);
my $closure_vars = PadWalker::closed_over($body);
my @env;
if ( my $constraints = delete $closure_vars->{'@type_constraints'} ) {
my @constraint_code = map {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Moxie/Traits/Provider/Experimental.pm view on Meta::CPAN
use Method::Traits ':for_providers';
use Carp ();
use Sub::Util (); # for setting the prototype of the lexical accessors
use PadWalker (); # for generating lexical accessors
use MOP::Util ();
our $VERSION = '0.07';
our $AUTHORITY = 'cpan:STEVAN';
lib/Moxie/Traits/Provider/Experimental.pm view on Meta::CPAN
my $class_is_immutable = ($meta->name)->isa('Moxie::Object::Immutable');
# now check the class local methods ....
foreach my $m ( $meta->methods ) {
# get a HASH of the things the method closes over
my $closed_over = PadWalker::closed_over( $m->body );
#warn Data::Dumper::Dumper({
# class => $meta->name,
# method => $m->name,
# closed_over => $closed_over,
lib/Moxie/Traits/Provider/Experimental.pm view on Meta::CPAN
# then this is as simple as assigning the HASH key
$closed_over->{ '&' . $method_name } = $accessor;
# okay, now restore the closed over vars
# with our new addition...
PadWalker::set_closed_over( $m->body, $closed_over );
}
}
});
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Net/API/CPAN/Mock.pm view on Meta::CPAN
phase => "runtime",
relationship => "requires",
version => 0.01,
},
{
module => "PadWalker",
phase => "runtime",
relationship => "requires",
version => 1,
},
{
lib/Net/API/CPAN/Mock.pm view on Meta::CPAN
prereqs => {
build => {
requires => { "Test::More" => 0.5 },
},
runtime => {
requires => { "Devel::Caller" => 1, "Devel::LexAlias" => 0.01, PadWalker => 1 },
},
},
release_status => "stable",
resources => { license => ["http://dev.perl.org/licenses/"] },
version => 0.04,
view all matches for this distribution
view release on metacpan or search on metacpan
_Deparsed_XSubs.pm view on Meta::CPAN
sub setlflag;
sub setoflag;
sub setospeed;
}
package PadWalker {
sub _upcontext;
sub closed_over;
sub peek_my;
sub peek_our;
sub peek_sub;
view all matches for this distribution
view release on metacpan or search on metacpan
2013-11-29 Brian M. Kelly <Brian.Kelly@fullautosoftware.net>
* Version 0.99999959 released.
* Added prerequisites Devel::Symdump and PadWalker.
2013-11-29 Brian M. Kelly <Brian.Kelly@fullautosoftware.net>
* Version 0.99999958 released.
view all matches for this distribution
view release on metacpan or search on metacpan
Debian_CPANTS.txt view on Meta::CPAN
"libopenoffice-oodoc-perl", "OpenOffice-OODoc", "2.111", "0", "0"
"liborlite-migrate-perl", "ORLite-Migrate", "1.06", "0", "0"
"liborlite-mirror-perl", "ORLite-Mirror", "1.18", "0", "0"
"liborlite-perl", "ORLite", "1.31", "0", "0"
"liborlite-statistics-perl", "ORLite-Statistics", "0.03", "0", "0"
"libpadwalker-perl", "PadWalker", "1.9", "0", "0"
"libpalm-perl", "p5-Palm", "1.011", "0", "1"
"libpango-perl", "Pango", "1.221", "0", "1"
"libpar-dist-perl", "PAR-Dist", "0.45", "0", "0"
"libpar-packer-perl", "PAR-Packer", "1.002", "0", "3"
"libpar-perl", "PAR", "0.994", "0", "1"
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Nile.pm view on Meta::CPAN
BEGIN {
$|=1;
use CGI::Carp qw(fatalsToBrowser warningsToBrowser set_message);
use Devel::StackTrace;
use Devel::StackTrace::AsHTML;
use PadWalker;
use Devel::StackTrace::WithLexicals;
sub handle_errors {
my $msg = shift;
#my $trace = Devel::StackTrace->new(indent => 1, message => $msg, ignore_package => [qw(Carp CGI::Carp)]);
view all matches for this distribution
view release on metacpan or search on metacpan
use strict;
use warnings;
our $VERSION = '0.02';
use PadWalker;
my $counter = 0;
my $opt_wrap = 1;
my $opt_export = 1;
}
}
# move lexically defined subs, too
my $pad = PadWalker::peek_my(1);
foreach my $x (keys %$pad) {
my $code = ${$pad->{$x}};
next unless ref($code) eq 'CODE';
substr($x, 0, 1, ''); # remove sigil
my $target = $package.'::'.$x;
# B::Generate were used to minipulate, runtime, which lexicals each saw, so
# code references could be copy, configured, and populated into namespaces?
#
#
# Lexical::Alias and PadWalker and AUTOLOAD together could do this:
# use the old-style hash dispatch logic, but before dispatching, each lexical
# in the PAD of the code reference would be aliased to a lexical stored in
# the per object hash.
#
# ie, given a blessed hash, $foo = { }, $foo->{my_method} might reference $a and $b.
view all matches for this distribution
view release on metacpan or search on metacpan
[BUGFIXES]
* Ignore some internal linker symbols in t/99exported-symbols.t
(RT138315)
* Remember to bump the version requirement of XS::Parse::Keyword in
the XS source (RT138318)
* Make slots visible to string-eval(), PadWalker, perl -d, etc..
(RT138399)
Development time for this release was partly sponsored by
Perl-Verein Schweiz
view all matches for this distribution
view release on metacpan or search on metacpan
lib/PDLdb.pl view on Meta::CPAN
next CMD;
};
=head4 C<y> - List lexicals in higher scope
Uses C<PadWalker> to find the lexicals supplied as arguments in a scope
above the current one and then displays then using C<dumpvar.pl>.
=cut
$cmd =~ /^y(?:\s+(\d*)\s*(.*))?$/ && do {
# See if we've got the necessary support.
eval { require PadWalker; PadWalker->VERSION(0.08) }
or &warn(
$@ =~ /locate/
? "PadWalker module not found - please install\n"
: $@
)
and next CMD;
# Load up dumpvar if we don't have it. If we can, that is.
lib/PDLdb.pl view on Meta::CPAN
# Got all the modules we need. Find them and print them.
my @vars = split( ' ', $2 || '' );
# Find the pad.
my $h = eval { PadWalker::peek_my( ( $1 || 0 ) + 1 ) };
# Oops. Can't find it.
$@ and $@ =~ s/ at .*//, &warn($@), next CMD;
# Show the desired vars with dumplex().
view all matches for this distribution
view release on metacpan or search on metacpan
next CMD;
};
=head4 C<y> - List lexicals in higher scope
Uses C<PadWalker> to find the lexicals supplied as arguments in a scope
above the current one and then displays then using C<dumpvar.pl>.
=cut
$cmd =~ /^y(?:\s+(\d*)\s*(.*))?$/ && do {
# See if we've got the necessary support.
eval { require PadWalker; PadWalker->VERSION(0.08) }
or &warn(
$@ =~ /locate/
? "PadWalker module not found - please install\n"
: $@
)
and next CMD;
# Load up dumpvar if we don't have it. If we can, that is.
# Got all the modules we need. Find them and print them.
my @vars = split( ' ', $2 || '' );
# Find the pad.
my $h = eval { PadWalker::peek_my( ( $1 || 0 ) + 1 ) };
# Oops. Can't find it.
$@ and $@ =~ s/ at .*//, &warn($@), next CMD;
# Show the desired vars with dumplex().
view all matches for this distribution
view release on metacpan or search on metacpan
next CMD;
};
=head4 C<y> - List lexicals in higher scope
Uses C<PadWalker> to find the lexicals supplied as arguments in a scope
above the current one and then displays then using C<dumpvar.pl>.
=cut
$cmd =~ /^y(?:\s+(\d*)\s*(.*))?$/ && do {
# See if we've got the necessary support.
eval { require PadWalker; PadWalker->VERSION(0.08) }
or &warn(
$@ =~ /locate/
? "PadWalker module not found - please install\n"
: $@
)
and next CMD;
# Load up dumpvar if we don't have it. If we can, that is.
# Got all the modules we need. Find them and print them.
my @vars = split( ' ', $2 || '' );
# Find the pad.
my $h = eval { PadWalker::peek_my( ( $1 || 0 ) + 1 ) };
# Oops. Can't find it.
$@ and $@ =~ s/ at .*//, &warn($@), next CMD;
# Show the desired vars with dumplex().
view all matches for this distribution
view release on metacpan or search on metacpan
lib/POD2/RU/perldebug.pod view on Meta::CPAN
X<debugger command, y>
Display all (or some) lexical variables (mnemonic: C<mY> variables)
in the current scope or I<level> scopes higher. You can limit the
variables that you see with I<vars> which works exactly as it does
for the C<V> and C<X> commands. Requires the C<PadWalker> module
version 0.08 or higher; will warn if this isn't installed. Output
is pretty-printed in the same style as for C<V> and the format is
controlled by the same options.
=item T
lib/POD2/RU/perldebug.pod view on Meta::CPAN
have full editing capabilities much like those GNU I<readline>(3) provides.
Look for these in the F<modules/by-module/Term> directory on CPAN.
These do not support normal B<vi> command-line editing, however.
A rudimentary command-line completion is also available, including
lexical variables in the current scope if the C<PadWalker> module
is installed.
Without Readline support you may see the symbols "^[[A", "^[[C", "^[[B",
"^[[D"", "^H", ... when using the arrow keys and/or the backspace key.
view all matches for this distribution
view release on metacpan or search on metacpan
Debian_CPANTS.txt view on Meta::CPAN
"libole-storage-lite-perl", "OLE-Storage_Lite", "0.18", "0", "0"
"libopengl-perl", "OpenGL", "0.56.dfsg.1", "0", "0"
"libopenoffice-oodoc-perl", "OpenOffice-OODoc", "2.107", "0", "0"
"liborlite-migrate-perl", "ORLite-Migrate", "0.01", "0", "0"
"liborlite-perl", "ORLite", "1.20", "0", "0"
"libpadwalker-perl", "PadWalker", "1.7", "0", "0"
"libpalm-perl", "p5-Palm", "1.009", "0", "0"
"libpango-perl", "http://qa.debian.org/watch/sf.php/gtk2-perl/Pango-1.220.tar.gz", "1.220", "0", "0"
"libpar-dist-perl", "PAR-Dist", "0.44", "0", "0"
"libpar-packer-perl", "PAR-Packer", "0.982", "0", "0"
"libpar-perl", "PAR", "0.991", "0", "0"
view all matches for this distribution
view release on metacpan or search on metacpan
lib/POE/Callback.pm view on Meta::CPAN
package POE::Callback;
use warnings;
use strict;
use PadWalker qw(var_name peek_my peek_sub);
use Scalar::Util qw(blessed reftype weaken);
use Devel::LexAlias qw(lexalias);
use Carp qw(croak);
# Track our wrappers to avoid wrapping them. Otherwise hilarity may
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Pad/Tie.pm view on Meta::CPAN
=head1 SEE ALSO
L<Pad::Tie::Plugin>
L<Lexical::Persistence>
L<Devel::LexAlias>
L<PadWalker>
L<Data::OptList>
=head1 AUTHOR
Hans Dieter Pearcey, C<< <hdp at cpan.org> >>
view all matches for this distribution
view release on metacpan or search on metacpan
PadWalker.pm view on Meta::CPAN
package PadWalker;
use strict;
use vars qw($VERSION @ISA @EXPORT_OK %EXPORT_TAGS);
require Exporter;
PadWalker.pm view on Meta::CPAN
@EXPORT_OK = qw(peek_my peek_our closed_over peek_sub var_name set_closed_over);
%EXPORT_TAGS = (all => \@EXPORT_OK);
$VERSION = '2.5';
bootstrap PadWalker $VERSION;
sub peek_my;
sub peek_our;
sub closed_over;
sub peek_sub;
PadWalker.pm view on Meta::CPAN
1;
__END__
=head1 NAME
PadWalker - play with other peoples' lexical variables
=head1 SYNOPSIS
use PadWalker qw(peek_my peek_our peek_sub closed_over);
...
=head1 DESCRIPTION
PadWalker is a module which allows you to inspect (and even change!)
lexical variables in any subroutine which called you. It will only
show those variables which are in scope at the point of the call.
PadWalker is particularly useful for debugging. It's even
used by Perl's built-in debugger. (It can also be used
for evil, of course.)
I wouldn't recommend using PadWalker directly in production
code, but it's your call. Some of the modules that use
PadWalker internally are certainly safe for and useful
in production.
=over 4
=item peek_my LEVEL
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Padre/Wx/FBP/Debugger.pm view on Meta::CPAN
Wx::gettext("Show Local Variables"),
Wx::DefaultPosition,
Wx::DefaultSize,
);
$self->{show_local_variables}->SetToolTip(
Wx::gettext("y [level [vars]]\nDisplay all (or some) lexical variables (mnemonic: mY variables) in the current scope or level scopes higher. You can limit the variables that you see with vars which works exactly as it does for the V and X commands....
);
Wx::Event::EVT_CHECKBOX(
$self,
$self->{show_local_variables},
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Params/Named.pm view on Meta::CPAN
@EXPORT = 'MAPARGS';
use strict;
use Carp qw/croak carp/;
use PadWalker 'var_name';
sub VAR { return {qw/SCALAR $ ARRAY @ HASH % REF $/}->{ref $_[0]}.$_[1]; }
sub _set_param {
my($p, $v, $n) = @_; # param, value, name
lib/Params/Named.pm view on Meta::CPAN
L<Sub::Parameters>, L<Sub::Signatures>, L<Params::Smart>
=head1 THANKS
Robin Houston for bug spotting, code refactoring, idea bouncing and releasing
a new version of L<PadWalker> (is there anything he can't do?).
=head1 AUTHOR
Dan Brook C<< <cpan@broquaint.com> >>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Params/Validate/Dependencies.pm view on Meta::CPAN
use Clone qw(clone);
use Params::Validate (); # don't import yet
use Params::Validate::Dependencies::Documenter;
use Scalar::Util qw(blessed);
use PadWalker qw(closed_over);
use base qw(Exporter);
use vars qw($VERSION @EXPORT @EXPORT_OK %EXPORT_TAGS $DOC);
view all matches for this distribution