Created
October 21, 2009 03:59
-
-
Save gfx/214862 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!perl -w | |
use strict; | |
use Test::More tests => 3; | |
{ | |
package T; | |
use Tie::Hash(); | |
use base qw(Tie::StdHash); | |
sub FETCH{ | |
my($self, $key) = @_; | |
# XXX: "require $key" is okey | |
eval "use $key(); 1"; | |
} | |
} | |
tie my(%t), 'T'; | |
ok $t{Cwd}, 'existing module'; | |
ok!$t{'No::Such::Module'}, 'non-existing module'; | |
ok $t{strict}, 'existing module'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment