App-TemplateCMD
view release on metacpan or search on metacpan
lib/App/TemplateCMD.pm view on Meta::CPAN
my %default = $module->default($self);
my @args = (
'out|o=s',
'args|a=s%',
'verbose|v!',
'path|p=s',
$module->args($self),
);
{
local @ARGV = @argv;
Getopt::Long::Configure('bundling');
GetOptions( \%default, @args ) or $module = 'App::TemplateCMD::Command::Help';
$default{files} = [ @ARGV ];
}
my $conf = $self->add_args(\%default);
my $out;
my $path = $conf->{path};
if ( $default{path} ) {
lib/App/TemplateCMD/Command/Print.pm view on Meta::CPAN
if ( $option{args}{tidy} ) {
if ( $option{args}{tidy} eq 'perl' ) {
eval { require Perl::Tidy };
if ($EVAL_ERROR) {
warn "Perl::Tidy is not installed, carn't tidy perl code\n";
}
else {
my $tidied;
eval {
local @ARGV;
Perl::Tidy::perltidy( source => \$out, destination => \$tidied );
$out = $tidied;
};
if ($EVAL_ERROR) {
warn "perltidy errored with: $EVAL_ERROR\n";
}
}
}
else {
warn "$option{args}{tidy}tidy";
( run in 1.253 second using v1.01-cache-2.11-cpan-49f99fa48dc )