view release on metacpan or search on metacpan
lib/JSON/Eval.pm view on Meta::CPAN
sub deparse_object {
my $self = shift;
my ($o) = @_;
if (ref $o eq 'CODE') {
require PadWalker;
my $lexicals = PadWalker::closed_over($o);
if (keys %$lexicals) {
require Carp;
Carp::croak("Cannot serialize coderef that closes over lexical variables to JSON: ".join ",", sort keys %$lexicals);
}
require B::Deparse;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Kavorka.pm view on Meta::CPAN
use warnings;
no warnings 'void';
use Carp ();
use Exporter::Tiny ();
use PadWalker ();
use Parse::Keyword ();
use Module::Runtime ();
use Scalar::Util ();
use Sub::Util ();
lib/Kavorka.pm view on Meta::CPAN
# Workarounds for closure issues in Parse::Keyword
if ($subroutine->is_anonymous)
{
my $orig = $r[0];
my $caller_vars = PadWalker::peek_my(1);
@r = Sub::Util::set_subname($subroutine->package."::__ANON__", sub {
$subroutine->_poke_pads($caller_vars);
goto $orig;
});
&Scalar::Util::set_prototype($r[0], $_) for grep defined, prototype($orig);
$INFO{ $r[0] } = $subroutine;
Scalar::Util::weaken($INFO{ $r[0] });
}
else
{
$subroutine->_poke_pads( PadWalker::peek_my(1) );
}
# Prevents a cycle between %INFO and $subroutine.
Scalar::Util::weaken($subroutine->{body})
unless Scalar::Util::isweak($subroutine->{body});
lib/Kavorka.pm view on Meta::CPAN
attributes don't work properly for anonymous functions.
=item *
This module is based on L<Parse::Keyword>, which has a chronically
broken implementation of closures. Kavorka uses L<PadWalker> to attempt
to work around the problem. This mostly seems to work, but you may
experience some problems in edge cases, especially for anonymous
functions and methods.
=item *
view all matches for this distribution
view release on metacpan or search on metacpan
lib/KiokuDB/TypeMap/Entry/Closure.pm view on Meta::CPAN
$KiokuDB::TypeMap::Entry::Closure::VERSION = '0.57';
use Moose;
use Carp qw(croak);
use Scalar::Util qw(refaddr);
use PadWalker 1.9;
use Class::Load ();
no warnings 'recursion';
use namespace::clean -except => 'meta';
lib/KiokuDB/TypeMap/Entry/Closure.pm view on Meta::CPAN
my %data;
# FIXME make this customizable on a per sub and per typemap level
if ( $name eq '__ANON__' ) {
my $pad = PadWalker::closed_over($sub);
if ( keys %$pad ) {
my $collapsed_pad = $collapser->visit($pad);
$data{pad} = $collapsed_pad;
lib/KiokuDB/TypeMap/Entry/Closure.pm view on Meta::CPAN
";
my $e = $@;
$linker->queue_finalizer(sub {
PadWalker::set_closed_over($sub, $pad);
}) if $sub;
( $sub, $e );
} else {
eval "sub $body", $@;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Lexical/Accessor.pm view on Meta::CPAN
Lexical::Accessor is almost three times faster than
L<MooX::PrivateAttributes>, and almost twenty time faster than
L<MooseX::Privacy>. I'd also argue that it's a more "correct"
implementation of private accessors as (short of performing impressive
L<PadWalker> manipulations), the accessors generated by this module
are completely invisible to subclasses, method dispatch, etc.
Compared to the usual Moose convention of using a leading underscore
to indicate a private method (which is a very loose convention; it is
quite common for subclasses to override such methods!),
view all matches for this distribution
view release on metacpan or search on metacpan
0.000007 Thu Nov 13 16:09:17 2014
- Simplified and sharpened t/inner_scalar.t
which also removed the requirement for PadWalker
(thanks Father C!)
0.001000 Tue Jul 4 17:54:22 2023
view all matches for this distribution
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
_Deparsed_XSubs.pm view on Meta::CPAN
sub namespace;
sub new;
sub remove_glob;
sub remove_symbol;
}
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
"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
"Locale::US" : "0",
"Module::CPANTS::Analyse" : "0.92",
"Module::Refresh" : "0",
"Moo" : "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