use Carp;
use DynaLoader;
-use vars qw( @ISA $VERSION );
use strict;
# Package globals
-@ISA = ( 'DynaLoader' );
-$VERSION = '1.03';
+our @ISA = ( 'DynaLoader' );
+our $VERSION = '1.09'; # remember to update version in POD!
my(%Locsyms) = ( ':ID' => 'LOCAL' );
my(%Gblsyms) = ( ':ID' => 'GLOBAL');
my $DoCache = 1;
sub new {
my($pkg,$type) = @_;
+ $type ||= 'LOCAL';
+ $type = 'LOCAL' unless $type eq 'GLOBAL';
bless { TYPE => $type }, $pkg;
}
#====> TIEHASH methods
sub TIEHASH {
- $_[0]->new(@_);
+ shift->new(@_);
}
sub FETCH {
if (!$DoCache || !$Cache_set) {
# We should eventually replace this with a C routine which walks the
# CLI symbol table directly. If I ever get 'hold of an I&DS manual . . .
- open(P,'Show Symbol * |');
+ open(P, '-|', 'Show Symbol *');
while (<P>) {
($name,$eqs,$val) = /^\s+(\S+) (=+) (.+)/
or carp "VMS::DCLsym: unparseable line $_";
$handle = new VMS::DCLsym;
$value = $handle->getsym($name);
- $handle->setsym($name,$value,'GLOBAL') or die "Can't create symbol: $!\n";
- $handle->delsym($name,'LOCAL') or die "Can't delete symbol: $!\n";
+ $handle->setsym($name, $value, 'GLOBAL')
+ or die "Can't create symbol: $!\n";
+ $handle->delsym($name, 'LOCAL') or die "Can't delete symbol: $!\n";
$handle->clearcache();
=head1 DESCRIPTION
deleting an element deletes the corresponding symbol. Setting an element to
C<undef>, or C<undef>ing it directly, sets the corresponding symbol to the null
string. You may also read the special keys ':GLOBAL' and ':LOCAL' to find out
-whether a default symbol table has been specified for this hash (see C<table>
-below), or set either or these keys to specify a default symbol table.
+whether a default symbol table has been specified for this hash (see the next
+paragraph), or set either or these keys to specify a default symbol table.
When you call the C<tie> function to bind an associative array to this package,
you may specify as an optional argument the symbol table in which you wish to
from outside (as is possible using some software from the net), the iterator
will be out of sync with the symbol table. If you expect this to happen, you
can reset the cache by calling this method. In addition, if you pass a FALSE
-value as the first argument, caching will be disabled. It can be reenabled
+value as the first argument, caching will be disabled. It can be re-enabled
later by calling C<clearcache> again with a TRUE value as the first argument.
It returns TRUE or FALSE to indicate whether caching was previously enabled or
disabled, respectively.
=head1 VERSION
-1.01 08-Dec-1996
+1.09
=head1 BUGS