summaryrefslogtreecommitdiff
path: root/lib/fields.pm
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>1998-02-19 19:54:52 +0200
committerMalcolm Beattie <mbeattie@sable.ox.ac.uk>1998-02-20 12:51:42 +0000
commitd516a115cc96334486070e15a6babcd1278d8de9 (patch)
tree590f1929dc6a081deeb2172c4f6674a11c4e5f61 /lib/fields.pm
parent156620fa44a712d84367040dea35ac6eae776347 (diff)
downloadperl-d516a115cc96334486070e15a6babcd1278d8de9.tar.gz
retry [PATCH] 5.004_59: the perlhist.pod etc
p4raw-id: //depot/perl@557
Diffstat (limited to 'lib/fields.pm')
-rw-r--r--lib/fields.pm23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/fields.pm b/lib/fields.pm
index 8e2d6398bb..c2cf1d6a5d 100644
--- a/lib/fields.pm
+++ b/lib/fields.pm
@@ -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;