Skip to content

Commit 688f0d5

Browse files
author
Chris White
committed
Cleanup [minor]
- Add missing dependency to Makefile.PL - Remove /r since it wasn't added until 5.14.
1 parent e01bf68 commit 688f0d5

File tree

3 files changed

+18
-19
lines changed

3 files changed

+18
-19
lines changed

Makefile.PL

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ WriteMakefile(
4747
'Carp' => '0',
4848
'Config' => '0',
4949
'File::Spec' => '0',
50+
'rlib' => '0',
5051
'Text::ParseWords' => '0',
5152
'Text::Diff' => '0', # for t/03-idempotency.t
5253
},

lib/Text/PerlPP.pm

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,10 @@ sub ExecuteCommand {
255255
};
256256
};
257257

258-
print "Macro code run:\n$code\n" =~ s/^/#/gmr
259-
if($self->{Opts}->{DEBUG});
258+
if($self->{Opts}->{DEBUG}) {
259+
(my $c = $code) =~ s/^/#/gm;
260+
emit "Macro code run:\n$c\n"
261+
}
260262
eval $code;
261263
my $err = $@; chomp $err;
262264
emit 'print ' . $self->PrepareString( $self->EndOB() ) . ";\n";
@@ -279,8 +281,10 @@ sub ExecuteCommand {
279281
$1
280282
};
281283
};
282-
print "Immediate code run:\n$code\n" =~ s/^/#/gmr
283-
if($self->{Opts}->{DEBUG});
284+
if($self->{Opts}->{DEBUG}) {
285+
(my $c = $code) =~ s/^/#/gm;
286+
emit "Immediate code run:\n$c\n"
287+
}
284288
eval( $code );
285289
my $err = $@; chomp $err;
286290

@@ -792,17 +796,12 @@ sub _parse_command_line {
792796

793797
sub Main {
794798
my $self = shift or die("Please use Text::PerlPP->new()->Main");
795-
796799
my $lrArgv = shift // [];
797-
#say STDERR "\n## -----------------\n## argv:\n",
798-
# (Dumper($lrArgv) =~ s/^/## /mgr);
799-
#say STDERR "self ", Dumper($self);
800+
800801
unless(_parse_command_line( $lrArgv, $self->{Opts} )) {
801802
return EXIT_OK; # TODO report param err vs. proc err?
802803
}
803804

804-
#say STDERR "## opts:\n", (Dumper($self->{Opts}) =~ s/^/## /mgr);
805-
806805
if($self->{Opts}->{PRINT_VERSION}) {
807806
print "PerlPP version $Text::PerlPP::VERSION\n";
808807
if($self->{Opts}->{PRINT_VERSION} > 1) {
@@ -892,9 +891,6 @@ sub Main {
892891
}
893892
keys %{$self->{Opts}->{SETS}};
894893

895-
#say STDERR "\n# Defs_RE: $self->{Defs_RE}";
896-
#say STDERR "# Defs_repl_text:\n", (Dumper($self->{Defs_repl_text})=~s/^/# /gmr);
897-
#say STDERR "# Sets\n", (Dumper($self->{Sets})=~s/^/# /gmr);
898894
# Make the copy for runtime
899895
emit "my %S = (\n";
900896
for my $defname (keys %{$self->{Opts}->{SETS}}) {

t/lib/PerlPPTest.pm

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ use Config;
2020
use IPC::Run3;
2121
use Text::ParseWords qw(shellwords);
2222

23-
# Debugging aids
24-
use Data::Dumper;
25-
use Devel::StackTrace;
23+
# Debugging aids. NOTE: not in Makefile.PL since we usually don't need them.
24+
# Install them manually if you want to use them.
25+
#use Data::Dumper;
26+
#use Devel::StackTrace;
2627

2728
our @EXPORT = qw(run_perlpp L count_tests);
2829
our @EXPORT_OK = qw(get_perl_filename);
@@ -31,8 +32,8 @@ our @EXPORT_OK = qw(get_perl_filename);
3132
# caller's filename:line number at the front of the list
3233
sub L {
3334
my (undef, $filename, $line) = caller;
34-
#say STDERR "\n## L trace:\n",
35-
# (Devel::StackTrace->new->as_string() =~ s/^/##/mgr);
35+
#do { (my $stacktrace = Devel::StackTrace->new->as_string()) =~ s/^/##/gm;
36+
#say STDERR "\n## L trace:\n$stacktrace"; }
3637
return ["$filename:$line", @_];
3738
} #L
3839

@@ -48,7 +49,8 @@ sub run_perlpp {
4849
my $retval;
4950

5051
$lrArgs = [shellwords($lrArgs)] if ref $lrArgs ne 'ARRAY';
51-
#say STDERR "## args:\n", (Dumper($lrArgs) =~ s/^/##/mgr);
52+
#do { (my $args = Dumper($lrArgs)) =~ s/^/##/gm;
53+
#say STDERR "## args:\n$args"; };
5254

5355
if($ENV{PERLPP_PERLOPTS}) {
5456
#my $cmd = join(' ', get_perl_filename(), $ENV{PERLPP_PERLOPTS},

0 commit comments

Comments
 (0)