This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix other pod versions that had become out of date, and add reminder comments
[perl5.git] / ext / VMS-DCLsym / DCLsym.pm
index 1bc72b8..ddee77f 100644 (file)
@@ -2,12 +2,11 @@ package VMS::DCLsym;
 
 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;
@@ -18,6 +17,8 @@ my $Cache_set = 0;
 
 sub new {
   my($pkg,$type) = @_;
+  $type ||= 'LOCAL';
+  $type = 'LOCAL' unless $type eq 'GLOBAL';
   bless { TYPE => $type }, $pkg;
 }
 
@@ -73,7 +74,7 @@ sub clearcache {
 #====> TIEHASH methods
 
 sub TIEHASH {
-  $_[0]->new(@_);
+  shift->new(@_);
 }
 
 sub FETCH {
@@ -103,7 +104,7 @@ sub FIRSTKEY {
   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 $_";
@@ -159,8 +160,9 @@ VMS::DCLsym - Perl extension to manipulate DCL symbols
 
   $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
@@ -183,8 +185,8 @@ defines a new symbol (or overwrites the old value of an existing symbol), and
 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
@@ -245,7 +247,7 @@ recorded, but in the rare event that someone changes the process' symbol table
 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.
@@ -262,7 +264,7 @@ Charles Bailey  bailey@newman.upenn.edu
 
 =head1 VERSION
 
-1.01  08-Dec-1996
+1.09
 
 =head1 BUGS