manual integration of all outstanding ansi branch stuff into mainline
[p5sagit/p5-mst-13.2.git] / lib / fields.pm
index 8e2d639..c2cf1d6 100644 (file)
@@ -1,5 +1,28 @@
 package fields;
 
+=head1 NAME
+
+fields - compile-time class fields
+
+=head1 SYNOPSIS
+
+    {
+        package Foo;
+        use fields qw(foo bar baz);
+    }
+    ...
+    my Foo $var = new Foo;
+    $var->{foo} = 42;
+
+    # This will generate a compile-time error.
+    $var->{zap} = 42;
+
+=head1 DESCRIPTION
+
+The C<fields> pragma enables compile-time verified class fields.
+
+=cut
+
 sub import {
     my $class = shift;
     my ($package) = caller;