Acme-Lexical-Thief

 view release on metacpan or  search on metacpan

META.json  view on Meta::CPAN

   "optional_features" : {},
   "prereqs" : {
      "configure" : {
         "requires" : {
            "ExtUtils::MakeMaker" : "6.17"
         }
      },
      "runtime" : {
         "requires" : {
            "Keyword::Simple" : "0",
            "PadWalker" : "0"
         }
      },
      "test" : {
         "requires" : {
            "Test::Fatal" : "0"
         }
      }
   },
   "provides" : {
      "Acme::Lexical::Thief" : {

META.yml  view on Meta::CPAN

    - inc
    - t
    - xt
optional_features: {}
provides:
  Acme::Lexical::Thief:
    file: lib/Acme/Lexical/Thief.pm
    version: '0.002'
requires:
  Keyword::Simple: '0'
  PadWalker: '0'
resources:
  X_identifier: http://purl.org/NET/cpan-uri/dist/Acme-Lexical-Thief/project
  bugtracker: http://rt.cpan.org/Dist/Display.html?Queue=Acme-Lexical-Thief
  homepage: https://metacpan.org/release/Acme-Lexical-Thief
  license: http://dev.perl.org/licenses/
  repository: git://github.com/tobyink/p5-acme-lexical-thief.git
version: '0.002'

Makefile.PL  view on Meta::CPAN

  "keywords"       => [],
  "license"        => ["perl_5"],
  "meta-spec"      => {
                        url => "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
                        version => 2,
                      },
  "name"           => "Acme-Lexical-Thief",
  "no_index"       => { directory => ["eg", "examples", "inc", "t", "xt"] },
  "prereqs"        => {
                        configure => { requires => { "ExtUtils::MakeMaker" => 6.17 } },
                        runtime => { requires => { "Keyword::Simple" => 0, "PadWalker" => 0 } },
                        test => { requires => { "Test::Fatal" => 0 } },
                      },
  "provides"       => {
                        "Acme::Lexical::Thief" => { file => "lib/Acme/Lexical/Thief.pm", version => 0.002 },
                      },
  "release_status" => "stable",
  "resources"      => {
                        bugtracker   => {
                                          web => "http://rt.cpan.org/Dist/Display.html?Queue=Acme-Lexical-Thief",
                                        },

README  view on Meta::CPAN


    Every time you peek at your caller's lexicals, a fairy dies.

    Just think about that for a minute, won't you?

BUGS
    Please report any bugs to
    <http://rt.cpan.org/Dist/Display.html?Queue=Acme-Lexical-Thief>.

SEE ALSO
    PadWalker - a slightly more sane alternative to peeking at your caller's
    lexicals.

    Data::Alias - a slightly more sane way of creating lexical aliases.

    This package was initially published on PerlMonks as `Acme::Asplode`
    <http://www.perlmonks.org/?node_id=1008814>, but I prefer the current
    name.

AUTHOR
    Toby Inkster <tobyink@cpan.org>.

doap.ttl  view on Meta::CPAN

@prefix foaf:  <http://xmlns.com/foaf/0.1/> .
@prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd:   <http://www.w3.org/2001/XMLSchema#> .

<http://dev.perl.org/licenses/>
	dc:title             "the same terms as the perl 5 programming language system itself".

<http://purl.org/NET/cpan-uri/dist/Acme-Lexical-Thief/project>
	a                    doap:Project;
	dc:contributor       <http://purl.org/NET/cpan-uri/person/tobyink>;
	doap-deps:runtime-requirement [ doap-deps:on "Keyword::Simple 0"^^doap-deps:CpanId ], [ doap-deps:on "PadWalker 0"^^doap-deps:CpanId ];
	doap-deps:test-requirement [ doap-deps:on "Test::Fatal 0"^^doap-deps:CpanId ];
	doap:bug-database    <http://rt.cpan.org/Dist/Display.html?Queue=Acme-Lexical-Thief>;
	doap:created         "2012-12-14"^^xsd:date;
	doap:developer       <http://purl.org/NET/cpan-uri/person/tobyink>;
	doap:download-page   <https://metacpan.org/release/Acme-Lexical-Thief>;
	doap:homepage        <https://metacpan.org/release/Acme-Lexical-Thief>;
	doap:license         <http://dev.perl.org/licenses/>;
	doap:maintainer      <http://purl.org/NET/cpan-uri/person/tobyink>;
	doap:name            "Acme-Lexical-Thief";
	doap:programming-language "Perl";

lib/Acme/Lexical/Thief.pm  view on Meta::CPAN

use warnings;
no warnings qw( once void uninitialized numeric );

BEGIN {
	$Acme::Lexical::Thief::AUTHORITY = 'cpan:TOBYINK';
	$Acme::Lexical::Thief::VERSION   = '0.002';
}

use Carp;
use Keyword::Simple ();
use PadWalker ();
use Text::Balanced ();

my $KEYWORD = 'steal';
my $CLASS   = __PACKAGE__;

sub import
{
	Keyword::Simple::define $KEYWORD, sub
	{
		my $ref = shift;

lib/Acme/Lexical/Thief.pm  view on Meta::CPAN

}

sub _callback
{
	my $vars  = shift;
	my $depth = shift // 0;
	
	$vars =~ s/(^\s*|\s*$)//g;
	my @vars = split /\s*,\s*/, $vars;
	
	my $MY  = PadWalker::peek_my($depth + 2);
	my $OUR = PadWalker::peek_our($depth + 2);
	return map {
		exists $MY->{$_}  ? $MY->{$_} :
		exists $OUR->{$_} ? $OUR->{$_} :
		croak "$KEYWORD($_) failed; caller has no $_ defined";
	} @vars;
}

1;

__END__

lib/Acme/Lexical/Thief.pm  view on Meta::CPAN


Just think about that for a minute, won't you?

=head1 BUGS

Please report any bugs to
L<http://rt.cpan.org/Dist/Display.html?Queue=Acme-Lexical-Thief>.

=head1 SEE ALSO

L<PadWalker> - a slightly more sane alternative to peeking at your caller's
lexicals.

L<Data::Alias> - a slightly more sane way of creating lexical aliases.

This package was initially published on PerlMonks as C<Acme::Asplode>
L<http://www.perlmonks.org/?node_id=1008814>, but I prefer the current
name.

=head1 AUTHOR



( run in 0.555 second using v1.01-cache-2.11-cpan-05444aca049 )