]> git.vpit.fr Git - perl/modules/Variable-Magic.git/blobdiff - t/28-uvar.t
Tweak some optional module loading in tests
[perl/modules/Variable-Magic.git] / t / 28-uvar.t
index 0eaf00130eba5b5efc0c3566e6bb283ed650d053..d44f9f1f0b38ad3ff17446eef7ab53b6b7a9e0c3 100644 (file)
@@ -51,8 +51,9 @@ $x = watch { $h{a} } { fetch => 1 }, 'fetch directly with also non uvar magic';
 is $x, 1, 'uvar: fetch directly with also non uvar magic correctly';
 
 SKIP: {
- eval "use Tie::Hash";
- skip 'Tie::Hash required to test uvar magic on tied hashes' => 2 * 5 + 4 if $@;
+ my $has_tie_hash = do { local $@; eval { require Tie::Hash; 1 } };
+ skip 'Tie::Hash required to test uvar magic on tied hashes'
+                                              => 2 * 5 + 4 unless $has_tie_hash;
  defined and diag "Using Tie::Hash $_" for $Tie::Hash::VERSION;
 
  tie my %h, 'Tie::StdHash';