in reply to use re 'debug';, scope, and output
but why is there output from re 'debug' showing up on my console even with the redirects? Why is the beginning part of the output being written to the console, and the rest stored in my redirected err.txt file?
Probably compile-time (BEGIN) versus run-time difference
What output is the debug command outputting to that I don't know about?
What? What is it that you know? What output is confusing?
confirmed:
#!/usr/bin/perl -- use strict; use warnings; use Capture::Tiny qw/ capture /; use Data::Dump qw/ dd /; my $string = 'd"alice'; my( $stdout, $stderr, $exit ) = capture { eval q{ use re 'debug'; $string =~ s/\bd\"//g; };}; $string =~ /alice/; dd( $stdout, $stderr, $exit , $string );
Without the "eval" Compiling REx and Freeing REx (BEGIN{} and END{} respectively) don't get captured in $stderr
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: use re 'debug';, scope, and output
by stevieb (Canon) on Jul 14, 2015 at 02:07 UTC | |
by Anonymous Monk on Jul 14, 2015 at 07:10 UTC |