1print "1..15\n"; 2 3require VMS::DCLsym or die "failed 1\n"; 4print "ok 1\n"; 5 6tie %syms, VMS::DCLsym or die "failed 2\n"; 7print "ok 2\n"; 8 9$name = 'FOO_'.time(); 10$syms{$name} = 'Perl_test'; 11print +($! ? "(\$! = $!) not " : ''),"ok 3\n"; 12 13print +($syms{$name} eq 'Perl_test' ? '' : 'not '),"ok 4\n"; 14 15($val) = `Show Symbol $name` =~ /(\w+)"$/; 16print +($val eq 'Perl_test' ? '' : 'not '),"ok 5\n"; 17 18while (($sym,$val) = each %syms) { 19 last if $sym eq $name && $val eq 'Perl_test'; 20} 21print +($sym ? '' : 'not '),"ok 6\n"; 22 23delete $syms{$name}; 24print +($! ? "(\$! = $!) not " : ''),"ok 7\n"; 25 26print +(defined($syms{$name}) ? 'not ' : ''),"ok 8\n"; 27undef %syms; 28 29$obj = new VMS::DCLsym 'GLOBAL'; 30print +($obj ? '' : 'not '),"ok 9\n"; 31 32print +($obj->clearcache(0) ? '' : 'not '),"ok 10\n"; 33print +($obj->clearcache(1) ? 'not ' : ''),"ok 11\n"; 34 35print +($obj->setsym($name,'Another_test') ? '' : 'not '),"ok 12\n"; 36 37($val,$tab) = $obj->getsym($name); 38print +($val eq 'Another_test' && $tab eq 'GLOBAL' ? '' : 'not '),"ok 13\n"; 39 40print +($obj->delsym($name,'LOCAL') ? 'not ' : ''),"ok 14\n"; 41print +($obj->delsym($name,'GLOBAL') ? '' : 'not '),"ok 15\n"; 42