4 require Config; import Config;
5 if ($Config{extensions} !~ /\bList\/Util\b/) {
6 print "1..0 # Skip: List::Util was not built\n";
11 use Scalar::Util qw(reftype);
12 use vars qw($t $y $x *F);
13 use Symbol qw(gensym);
15 # Ensure we do not trigger and tied methods
28 # [ IO => *STDIN{IO} ] the internal sv_reftype returns UNKNOWN
31 print "1..", @test*4, "\n";
34 foreach $test (@test) {
35 my($type,$what) = @$test;
37 foreach $pack (undef,"ABC","0",undef) {
39 my $res = reftype($what);
40 printf "# %s - %s\n", map { defined($_) ? $_ : 'undef' } $type,$res;
41 print "not " if $type ? $res ne $type : defined($res);
42 bless $what, $pack if $type && defined $pack;
43 print "ok ",$i++,"\n";
49 sub TIEHANDLE { bless {} }
53 warn "$AUTOLOAD called";
54 exit 1; # May be in an eval