From: Ken Neighbors Date: Thu, 19 Sep 2002 18:48:22 +0000 (+0000) Subject: [perl #17445] Class::Struct patch: version number, examples X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7a75f23295b1c1b6088ac400a7ad3d07428a20c1;p=p5sagit%2Fp5-mst-13.2.git [perl #17445] Class::Struct patch: version number, examples From: Ken Neighbors (via RT) Message-Id: p4raw-id: //depot/perl@17930 --- diff --git a/lib/Class/Struct.pm b/lib/Class/Struct.pm index c46ebcd..ec080a1 100644 --- a/lib/Class/Struct.pm +++ b/lib/Class/Struct.pm @@ -14,7 +14,7 @@ require Exporter; @ISA = qw(Exporter); @EXPORT = qw(struct); -$VERSION = '0.61'; +$VERSION = '0.63'; ## Tested on 5.002 and 5.003 without class membership tests: my $CHECK_CLASS_MEMBERSHIP = ($] >= 5.003_95); @@ -463,13 +463,13 @@ type C. use Class::Struct; struct( Rusage => { - ru_utime => 'Timeval', # seconds - ru_stime => 'Timeval', # microseconds + ru_utime => 'Timeval', # user time used + ru_stime => 'Timeval', # system time used }); struct( Timeval => [ - tv_secs => '$', - tv_usecs => '$', + tv_secs => '$', # seconds + tv_usecs => '$', # microseconds ]); # create an object: @@ -500,10 +500,10 @@ accessor accordingly. my $self = shift; if ( @_ ) { die 'count must be nonnegative' if $_[0] < 0; - $self->{'count'} = shift; + $self->{'MyObj::count'} = shift; warn "Too many args to count" if @_; } - return $self->{'count'}; + return $self->{'MyObj::count'}; } package main;