diff options
Diffstat (limited to 'gnu/usr.bin/perl/lib/Tie')
-rw-r--r-- | gnu/usr.bin/perl/lib/Tie/Hash.pm | 7 | ||||
-rw-r--r-- | gnu/usr.bin/perl/lib/Tie/RefHash.pm | 7 | ||||
-rw-r--r-- | gnu/usr.bin/perl/lib/Tie/Scalar.pm | 23 |
3 files changed, 21 insertions, 16 deletions
diff --git a/gnu/usr.bin/perl/lib/Tie/Hash.pm b/gnu/usr.bin/perl/lib/Tie/Hash.pm index 2902efb4d0d..c6ec3d4f5c6 100644 --- a/gnu/usr.bin/perl/lib/Tie/Hash.pm +++ b/gnu/usr.bin/perl/lib/Tie/Hash.pm @@ -73,6 +73,8 @@ Return the next key for the hash. Verify that I<key> exists with the tied hash I<this>. +The B<Tie::Hash> implementation is a stub that simply croaks. + =item DELETE this, key Delete the key I<key> from the tied hash I<this>. @@ -100,6 +102,7 @@ good working examples. =cut use Carp; +use warnings::register; sub new { my $pkg = shift; @@ -111,8 +114,8 @@ sub new { sub TIEHASH { my $pkg = shift; if (defined &{"${pkg}::new"}) { - carp "WARNING: calling ${pkg}->new since ${pkg}->TIEHASH is missing" - if $^W; + warnings::warn "WARNING: calling ${pkg}->new since ${pkg}->TIEHASH is missing" + if warnings::enabled(); $pkg->new(@_); } else { diff --git a/gnu/usr.bin/perl/lib/Tie/RefHash.pm b/gnu/usr.bin/perl/lib/Tie/RefHash.pm index 66de2572fcd..ffa9eb20a00 100644 --- a/gnu/usr.bin/perl/lib/Tie/RefHash.pm +++ b/gnu/usr.bin/perl/lib/Tie/RefHash.pm @@ -39,11 +39,11 @@ see the C<tie> entry in perlfunc(1) and perltie(1) for more information. =head1 AUTHOR -Gurusamy Sarathy gsar@umich.edu +Gurusamy Sarathy gsar@activestate.com =head1 VERSION -Version 1.2 15 Dec 1996 +Version 1.21 22 Jun 1999 =head1 SEE ALSO @@ -94,7 +94,8 @@ sub EXISTS { sub FIRSTKEY { my $s = shift; - my $a = scalar(keys %{$s->[0]}) + scalar(keys %{$s->[1]}); + keys %{$s->[0]}; # reset iterator + keys %{$s->[1]}; # reset iterator $s->[2] = 0; $s->NEXTKEY; } diff --git a/gnu/usr.bin/perl/lib/Tie/Scalar.pm b/gnu/usr.bin/perl/lib/Tie/Scalar.pm index ef27dc1398c..0c6759006f0 100644 --- a/gnu/usr.bin/perl/lib/Tie/Scalar.pm +++ b/gnu/usr.bin/perl/lib/Tie/Scalar.pm @@ -8,24 +8,24 @@ Tie::Scalar, Tie::StdScalar - base class definitions for tied scalars package NewScalar; require Tie::Scalar; - + @ISA = (Tie::Scalar); - + sub FETCH { ... } # Provide a needed method sub TIESCALAR { ... } # Overrides inherited method - - + + package NewStdScalar; require Tie::Scalar; - + @ISA = (Tie::StdScalar); - + # All methods provided by default, so define only what needs be overridden sub FETCH { ... } - - + + package main; - + tie $new_scalar, 'NewScalar'; tie $new_std_scalar, 'NewStdScalar'; @@ -79,6 +79,7 @@ process IDs with priority. =cut use Carp; +use warnings::register; sub new { my $pkg = shift; @@ -90,8 +91,8 @@ sub new { sub TIESCALAR { my $pkg = shift; if (defined &{"{$pkg}::new"}) { - carp "WARNING: calling ${pkg}->new since ${pkg}->TIESCALAR is missing" - if $^W; + warnings::warn "WARNING: calling ${pkg}->new since ${pkg}->TIESCALAR is missing" + if warnings::enabled(); $pkg->new(@_); } else { |