Subject: | loading Test::LeakTrace in a string eval doesn't work |
the following test script fails using a common (and recommended) idiom
of loading a module in a string eval. to get this to work, one must load
Test::LeakTrace again outside the eval.
#!perl -w
use strict;
use warnings;
use Test::More;
eval "use Test::LeakTrace; 1";
if ($@) {
plan skip_all => "Test::LeakTrace isn't installed";
}
plan tests => 1;
leaks_cmp_ok {
my $a = 1;
} '<', 1;