]> git.vpit.fr Git - perl/modules/Variable-Magic.git/blobdiff - t/16-huf.t
Tweak some optional module loading in tests
[perl/modules/Variable-Magic.git] / t / 16-huf.t
index 32f767770749e8bd8fe41f33397652d8ffff6c77..af9e74022a62ef2513bc2731c114f18ccd364f49 100644 (file)
@@ -11,13 +11,15 @@ if (!VMG_UVAR) {
  plan skip_all => 'No nice uvar magic for this perl';
 }
 
-eval "use Hash::Util::FieldHash";
-if ($@) {
- plan skip_all => 'Hash::Util::FieldHash required for testing uvar interaction';
-} else {
- plan tests => 2 * 5 + 7 + 1;
- defined and diag "Using Hash::Util::FieldHash $_"
+{
+ local $@;
+ if (eval { require Hash::Util::FieldHash; 1 }) {
+  plan tests => 2 * 5 + 7 + 1;
+  defined and diag "Using Hash::Util::FieldHash $_"
                                             for $Hash::Util::FieldHash::VERSION;
+ } else {
+  plan skip_all => 'Hash::Util::FieldHash required for testing uvar interaction'
+ }
 }
 
 use lib 't/lib';