The array @Spectra::DEV contains the names of the devices.
#!/usr/bin/perl
my $ndev = @Spectra::DEV;
foreach my $i ( 0 .. ($ndev - 1))
{
print " $i $Spectra::DEV[ $i]\n";
}
The hash %SYM contains the Spectra symbol table. The following example demonstrates how the symbols are set, read and deleted:
#!/usr/bin/perl
use Spectra;
#
# symbols are defined by:
#
$SYM{ s1} = "this is a test";
#
# the next statement is an example for a read access:
#
print " Symbol s1 has the value \"$SYM{ s1}\"\n";
#
# listing all symbols:
#
print "\n List all symbols: \n";
foreach $sym (keys %SYM)
{
print " $sym = $SYM{ $sym} \n";
}
#
# deleting symbol s1:
#
delete $SYM{ s1};
The array @MAR contains the markers.
#!/usr/bin/perl use Spectra; # # set 3 marker # @MAR = (1, 2, 3); $len = @MAR; print " Defined 3 marker: @MAR, len $len\n"; # # clear the marker array # @MAR = (); $len = @MAR; print " cleared marker, len $len\n";