blob: 50feed8d78981d75a658a7fe5d01923be1a14f3a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
#!/usr/bin/perl
use NASTD;
$nasthole = &NASTD::nast_sphincter_new();
if (!defined($nasthole)) {
exit(1);
}
@options = &NASTD::nast_options_get($nasthole);
if (!defined(@options)) {
print STDERR "Couldn't get options: " .
&NASTD::nast_errmsg($nasthole) . "\n";
exit(1);
}
$options[5] = 1;
if (&NASTD::nast_options_set($nasthole, @options) == -1) {
print STDERR "Couldn't set options: " .
&NASTD::nast_errmsg($nasthole) . "\n";
exit(1);
}
if (&NASTD::nast_get($nasthole, "asljkda") == -1) {
print STDERR "Couldn't perform get: " .
&NASTD::nast_errmsg($nasthole) . "\n";
exit(1);
}
@vals = &NASTD::nast_get_result($nasthole);
$nitems = $#vals + 1;
print "Number of columns: " . $nitems . "\n";
for ($i = 0; $i < $nitems; $i++) {
$val = shift(@vals);
print "Result[$i]: $val\n";
}
&NASTD::nast_sphincter_close($nasthole);
|