Acme-PPIx-MetaSyntactic

 view release on metacpan or  search on metacpan

LICENSE  view on Meta::CPAN

changed that file, and provided that you do at least ONE of the following:

  a) place your modifications in the Public Domain or otherwise make them
     Freely Available, such as by posting said modifications to Usenet or an
     equivalent medium, or placing the modifications on a major archive site
     such as ftp.uu.net, or by allowing the Copyright Holder to include your
     modifications in the Standard Version of the Package.

  b) use the modified Package only within your corporation or organization.

  c) rename any non-standard executables so the names do not conflict with
     standard executables, which must also be provided, and provide a separate
     manual page for each non-standard executable that clearly documents how it
     differs from the Standard Version.

  d) make other distribution arrangements with the Copyright Holder.

4. You may distribute the programs of this Package in object code or executable
form, provided that you do at least ONE of the following:

  a) distribute a Standard Version of the executables and library files,

META.json  view on Meta::CPAN

{
   "abstract" : "rename functions and variables in a PPI::Document using Acme::MetaSyntactic",
   "author" : [
      "Toby Inkster (TOBYINK) <tobyink@cpan.org>"
   ],
   "dynamic_config" : 0,
   "generated_by" : "Dist::Inkt::Profile::TOBYINK version 0.024, CPAN::Meta::Converter version 2.150010",
   "keywords" : [],
   "license" : [
      "perl_5"
   ],
   "meta-spec" : {

META.yml  view on Meta::CPAN

---
abstract: 'rename functions and variables in a PPI::Document using Acme::MetaSyntactic'
author:
  - 'Toby Inkster (TOBYINK) <tobyink@cpan.org>'
build_requires: {}
configure_requires:
  ExtUtils::MakeMaker: '6.17'
dynamic_config: 0
generated_by: 'Dist::Inkt::Profile::TOBYINK version 0.024, CPAN::Meta::Converter version 2.150010'
keywords: []
license: perl
meta-spec:

Makefile.PL  view on Meta::CPAN

use strict;
use ExtUtils::MakeMaker 6.17;

my $EUMM = eval( $ExtUtils::MakeMaker::VERSION );

my $meta = {
  "abstract"           => "rename functions and variables in a PPI::Document using Acme::MetaSyntactic",
  "author"             => ["Toby Inkster (TOBYINK) <tobyink\@cpan.org>"],
  "dynamic_config"     => 0,
  "generated_by"       => "Dist::Inkt::Profile::TOBYINK version 0.024, CPAN::Meta::Converter version 2.150010",
  "keywords"           => [],
  "license"            => ["perl_5"],
  "meta-spec"          => {
                            url => "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
                            version => 2,
                          },
  "name"               => "Acme-PPIx-MetaSyntactic",

README  view on Meta::CPAN

NAME
    Acme::PPIx::MetaSyntactic - rename functions and variables in a
    PPI::Document using Acme::MetaSyntactic

SYNOPSIS
     my $acme = "Acme::PPIx::MetaSyntactic"->new(document => \<<'END');
     use v5.010;
     use constant PLACE => "World";
 
     sub join_spaces {
        return join " ", @_;
     }

bin/perl-metasyntactic  view on Meta::CPAN

print $out->document;

__END__

=pod

=encoding utf-8

=head1 NAME

perl-metasyntactic - rename functions and variables in a Perl document

=head1 USAGE

 perl-metasyntactic <input.pl >output.pl

=head1 DESCRIPTION

This command uses L<Acme::PPIx::MetaSyntactic> to munge a Perl script.

=head1 OPTIONS

doap.ttl  view on Meta::CPAN

	doap:homepage        <https://metacpan.org/release/Acme-PPIx-MetaSyntactic>;
	doap:license         <http://dev.perl.org/licenses/>;
	doap:maintainer      <http://purl.org/NET/cpan-uri/person/tobyink>;
	doap:name            "Acme-PPIx-MetaSyntactic";
	doap:programming-language "Perl";
	doap:release         <http://purl.org/NET/cpan-uri/dist/Acme-PPIx-MetaSyntactic/v_0-001>, <http://purl.org/NET/cpan-uri/dist/Acme-PPIx-MetaSyntactic/v_0-002>, <http://purl.org/NET/cpan-uri/dist/Acme-PPIx-MetaSyntactic/v_0-003>, <http://purl.org/NET/...
	doap:repository      [
		a doap:HgRepository;
		doap:browse <https://bitbucket.org/tobyink/p5-acme-ppix-metasyntactic>;
	];
	doap:shortdesc       "rename functions and variables in a PPI::Document using Acme::MetaSyntactic".

<http://purl.org/NET/cpan-uri/dist/Acme-PPIx-MetaSyntactic/v_0-001>
	a                    doap:Version;
	rdfs:label           "Initial release";
	dc:identifier        "Acme-PPIx-MetaSyntactic-0.001"^^xsd:string;
	dc:issued            "2013-05-15"^^xsd:date;
	doap-changeset:released-by <http://purl.org/NET/cpan-uri/person/tobyink>;
	doap:file-release    <http://backpan.cpan.org/authors/id/T/TO/TOBYINK/Acme-PPIx-MetaSyntactic-0.001.tar.gz>;
	doap:revision        "0.001"^^xsd:string.

lib/Acme/PPIx/MetaSyntactic.pm  view on Meta::CPAN

		# defined sub. This might be a __PACKAGE__->can("foo"), so change it!
		# 
		if ($ls->{$qq->string})
		{
			my $txt = "$qq";
			$txt =~ s/${\quotemeta($qq->string)}/$n->{$qq->string}/eg;
			$qq->set_content($txt);
		}
		
		# An interpolated string. We'll do our best to find any variables
		# within it and rename them, but PPI doesn't really look inside
		# interpolated strings (yet?).
		# 
		elsif ($qq->isa("PPI::Token::Quote::Double") or $qq->isa("PPI::Token::Quote::Interpolate"))
		{
			my $txt = "$qq";
			$txt =~ s/([\$\@]\w+)/$n->{$1}?substr($1,0,1).$n->{$1}:$1/eg;
			$qq->set_content($txt);
		}
	}
}

lib/Acme/PPIx/MetaSyntactic.pm  view on Meta::CPAN

1;

__END__

=pod

=encoding utf-8

=head1 NAME

Acme::PPIx::MetaSyntactic - rename functions and variables in a PPI::Document using Acme::MetaSyntactic

=head1 SYNOPSIS

 my $acme = "Acme::PPIx::MetaSyntactic"->new(document => \<<'END');
 use v5.010;
 use constant PLACE => "World";
 
 sub join_spaces {
    return join " ", @_;
 }



( run in 0.503 second using v1.01-cache-2.11-cpan-e9daa2b36ef )