#!/usr/bin/env perl

use Acme::PPIx::MetaSyntactic;

my $in = do { local $/ = <> };

my $out = "Acme::PPIx::MetaSyntactic"->new(
	document => \$in,
	theme    => $ENV{PERL_METASYNTACTIC_THEME} || "haddock",
);

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

The filename to operate on can be passed as a parameter; otherwise
C<perl-metasyntactic> will operate on STDIN.

=head1 ENVIRONMENT

The C<PERL_METASYNTACTIC_THEME> environment variable can be set to a
theme for L<Acme::MetaSyntactic>. It defaults to C<< "haddock" >>.

=head1 BUGS

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

=head1 SEE ALSO

L<Acme::PPIx::MetaSyntactic>, L<perltidy>.

=head1 AUTHOR

Toby Inkster E<lt>tobyink@cpan.orgE<gt>.

=head1 COPYRIGHT AND LICENCE

This software is copyright (c) 2013 by Toby Inkster.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=head1 DISCLAIMER OF WARRANTIES

THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.

