summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDamian Conway <damian@cs.monash.edu.au>2002-07-31 09:03:14 +1000
committerhv <hv@crypt.org>2002-08-08 14:49:00 +0000
commitfeb6f007033805f50279da3c0c8a2b3dc41cec48 (patch)
tree9887adf8dd67a964fdb62a3b56d82b4615e6fb3a /lib
parent89900bd3f9798cf0a5e524a809c7f1bb1b066fa2 (diff)
downloadperl-feb6f007033805f50279da3c0c8a2b3dc41cec48.tar.gz
Doc patch for Class::Struct under 5.8.0
Message-id: <3D471FCF.1C7C6E6B@conway.org> p4raw-id: //depot/perl@17697
Diffstat (limited to 'lib')
-rw-r--r--lib/Class/Struct.pm18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/Class/Struct.pm b/lib/Class/Struct.pm
index bad4f78165..c46ebcd26d 100644
--- a/lib/Class/Struct.pm
+++ b/lib/Class/Struct.pm
@@ -456,26 +456,26 @@ See Example 3 below for an example of initialization.
=item Example 1
Giving a struct element a class type that is also a struct is how
-structs are nested. Here, C<timeval> represents a time (seconds and
-microseconds), and C<rusage> has two elements, each of which is of
-type C<timeval>.
+structs are nested. Here, C<Timeval> represents a time (seconds and
+microseconds), and C<Rusage> has two elements, each of which is of
+type C<Timeval>.
use Class::Struct;
- struct( rusage => {
- ru_utime => timeval, # seconds
- ru_stime => timeval, # microseconds
+ struct( Rusage => {
+ ru_utime => 'Timeval', # seconds
+ ru_stime => 'Timeval', # microseconds
});
- struct( timeval => [
+ struct( Timeval => [
tv_secs => '$',
tv_usecs => '$',
]);
# create an object:
- my $t = new rusage;
+ my $t = Rusage->new(ru_utime=>Timeval->new(), ru_stime=>Timeval->new());
- # $t->ru_utime and $t->ru_stime are objects of type timeval.
+ # $t->ru_utime and $t->ru_stime are objects of type Timeval.
# set $t->ru_utime to 100.0 sec and $t->ru_stime to 5.0 sec.
$t->ru_utime->tv_secs(100);
$t->ru_utime->tv_usecs(0);