#!/usr/bin/perl
use IO::Scalar;
my ($out, $SH);
BEGIN {
$SH = new IO::Scalar \$out;
};
use Acme::Echo qw/after/, 'src_fmt' => "CODE RAN WAS:
\n
\n%s\n\n", fh => $SH; use strict; use warnings; use Test::More tests => 2; my $s = 0; foreach (1 .. 10){ $s += $_; } no Acme::Echo; my $expected = do { local $/ = undef; }; is( $out, $expected, "output matches" ); is( $s, 55, "s=55" ); __DATA__ CODE RAN WAS:
use strict;
use warnings;
use Test::More tests => 2;
my $s = 0;
foreach (1 .. 10){
$s += $_;
}