home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
perl502b.zip
/
ext
/
OS2
/
REXX
/
rx1.pl
< prev
next >
Wrap
Text File
|
1995-05-13
|
1KB
|
73 lines
use REXX;
#
# DLL
#
$ydba = load REXX "ydbautil" or die "load";
#
# function
#
if (1) {
@pid = $ydba->RxProcId();
print @pid, "\n";
@pid = $ydba->RxProcId();
print @pid, "\n";
}
#
# scalar
#
if (1) {
tie $s, REXX, "TEST";
$s = 1;
print $s;
untie $s;
}
#
# hash
#
if (1) {
tie %all, REXX, ""; # all REXX vars
sub show
{
# show all REXX vars
print "--@_--\n";
foreach (keys %all) {
$v = $all{$_};
print "$_ => $v\n";
}
}
tie %h, REXX, "TEST.";
show("initial");
$h{"one"} = 1;
show("1st item");
$h{"two"} = 2;
show("2nd item");
$h{"one"} = "";
show("emptied 1st");
print "one exists\n" if exists $h{"one"};
print "two exists\n" if exists $h{"two"};
delete $h{"one"};
show("deleted 1st");
print "one exists\n" if exists $h{"one"};
print "two exists\n" if exists $h{"two"};
REXX::drop("TEST.");
show("dropped TEST.");
print "one exists\n" if exists $h{"one"};
print "two exists\n" if exists $h{"two"};
untie %h;
}
$ydba->nixda();