SYN SYN
[p5sagit/p5-mst-13.2.git] / lib / Class / Struct.pm
index 3e08e80..ac1fb47 100644 (file)
@@ -2,10 +2,11 @@ package Class::Struct;
 
 ## See POD after __END__
 
-require 5.002;
+use 5.005_64;
 
 use strict;
-use vars qw(@ISA @EXPORT $VERSION);
+use warnings::register;
+our(@ISA, @EXPORT, $VERSION);
 
 use Carp;
 
@@ -167,8 +168,7 @@ sub struct {
     $cnt = 0;
     foreach $name (@methods){
         if ( do { no strict 'refs'; defined &{$class . "::$name"} } ) {
-            carp "function '$name' already defined, overrides struct accessor method"
-                if $^W;
+            warnings::warnif("function '$name' already defined, overrides struct accessor method");
         }
         else {
             $pre = $pst = $cmt = $sel = '';
@@ -355,7 +355,7 @@ The element is an array, initialized by default to C<()>.
 
 With no argument, the accessor returns a reference to the
 element's whole array (whether or not the element was
-specified as C<'@'> or C<'*@').
+specified as C<'@'> or C<'*@'>).
 
 With one or two arguments, the first argument is an index
 specifying one element of the array; the second argument, if
@@ -370,7 +370,7 @@ The element is a hash, initialized by default to C<()>.
 
 With no argument, the accessor returns a reference to the
 element's whole hash (whether or not the element was
-specified as C<'%'> or C<'*%').
+specified as C<'%'> or C<'*%'>).
 
 With one or two arguments, the first argument is a key specifying
 one element of the hash; the second argument, if present, is
@@ -520,6 +520,7 @@ struct's constructor.
     print "(which was a ", $cat->breed->name, ")\n";
     print "had two kittens: ", join(' and ', @{$cat->kittens}), "\n";
 
+=back
 
 =head1 Author and Modification History