diff options
author | Abigail <abigail@abigail.be> | 2010-02-20 18:54:15 +0100 |
---|---|---|
committer | Abigail <abigail@abigail.be> | 2010-02-20 18:54:15 +0100 |
commit | b588e26b0530f7ecd738579dc5febbca2ebc6d7b (patch) | |
tree | 2b35d1b2e0c089a1f68c16bc08b21eceb9ec329a /lib/Tie | |
parent | 9b49dc400d59e69f15e3fb678ee168366d322633 (diff) | |
download | perl-b588e26b0530f7ecd738579dc5febbca2ebc6d7b.tar.gz |
Document differences between Tie::Scalar and Tie::StdScalar
Diffstat (limited to 'lib/Tie')
-rw-r--r-- | lib/Tie/Scalar.pm | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/Tie/Scalar.pm b/lib/Tie/Scalar.pm index 9bf03f9105..8048569729 100644 --- a/lib/Tie/Scalar.pm +++ b/lib/Tie/Scalar.pm @@ -73,6 +73,18 @@ destruction of an instance. =back +=head2 Tie::Scalar vs Tie::StdScalar + +C<< Tie::Scalar >> provides all the necessary methods, but one should realize +they do not do anything useful. Calling C<< Tie::Scalar::FETCH >> or +C<< Tie::Scalar::STORE >> results in a (trappable) croak. And if you inherit +from C<< Tie::Scalar >>, you I<must> provide either a C<< new >> or a +C<< TIESCALAR >> method. + +If you are looking for a class that does everything for you you don't +define yourself, use the C<< Tie::StdScalar >> class, not the +C<< Tie::Scalar >> one. + =head1 MORE INFORMATION The L<perltie> section uses a good example of tying scalars by associating |