From: Vincent Pit Date: Thu, 16 Feb 2012 22:11:20 +0000 (+0100) Subject: Protect $@ inside Variable::Magic::TestWatcher::init_watcher X-Git-Tag: v0.48~7 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FVariable-Magic.git;a=commitdiff_plain;h=20cffa3667611284cad478382155c3582754240b Protect $@ inside Variable::Magic::TestWatcher::init_watcher --- diff --git a/t/lib/Variable/Magic/TestWatcher.pm b/t/lib/Variable/Magic/TestWatcher.pm index 98a4b08..a849922 100644 --- a/t/lib/Variable/Magic/TestWatcher.pm +++ b/t/lib/Variable/Magic/TestWatcher.pm @@ -28,6 +28,7 @@ sub init_watcher ($;$) { croak 'can\'t initialize twice' if defined $wiz; my $types = _types shift; $prefix = (defined) ? "$_: " : '' for shift; + local $@; %mg = (); $wiz = eval 'wizard ' . join(', ', map { "$_ => sub { \$mg{$_}++;" . ($_ eq 'len' ? '$_[2]' : '0') . '}'