2 chdir 't' if -d 't/lib';
3 @INC = '../lib' if -d 'lib';
4 require Config; import Config;
5 if (-d 'lib' and $Config{'extensions'} !~ /\bOS2::REXX\b/) {
14 $path = $ENV{LIBPATH} || $ENV{PATH} or die;
15 foreach $dir (split(';', $path)) {
16 next unless -f "$dir/$name.DLL";
17 $found = "$dir/$name.DLL";
18 print "# found at `$found'\n";
21 $found or die "1..0\n#Cannot find $name.DLL\n";
26 $vrexx = DynaLoader::dl_load_file($found) or die "not ok 1\n# load\n";
28 $vinit = DynaLoader::dl_find_symbol($vrexx, "VINIT") or die "find vinit";
30 $vexit = DynaLoader::dl_find_symbol($vrexx, "VEXIT") or die "find vexit";
32 $vmsgbox = DynaLoader::dl_find_symbol($vrexx, "VMSGBOX") or die "find vmsgbox";
34 $vversion= DynaLoader::dl_find_symbol($vrexx, "VGETVERSION") or die "find vgetversion";
37 $result = OS2::REXX::_call("VInit", $vinit) or die "VInit";
39 print "# VInit: $result\n";
41 OS2::REXX::_set("MBOX.0" => 4,
42 "MBOX.1" => "Perl VREXX Access Test",
44 "MBOX.3" => "(C) Andreas Kaiser",
45 "MBOX.4" => "December 1994")
49 $result = OS2::REXX::_call("VGetVersion", $vversion) or die "VMsgBox";
51 print "# VGetVersion: $result\n";
53 $result = OS2::REXX::_call("VMsgBox", $vmsgbox, "", "Perl", "MBOX", 1) or die "VMsgBox";
55 print "# VMsgBox: $result\n";
57 OS2::REXX::_call("VExit", $vexit);