JamesNC has asked for the wisdom of the Perl Monks concerning the following question:
use Class::Struct; #use strict; struct( rusage => { ru_utime => timeval, # seconds ru_stime => timeval, # microseconds }); struct( timeval => [ tv_secs => '$', tv_usecs => '$', ]); # create an object: my $t = new rusage; # $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); $t->ru_stime->tv_secs(5); $t->ru_stime->tv_usecs(0);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Class::Struct example fails..syntax problem?
by bbfu (Curate) on Apr 18, 2003 at 21:30 UTC | |
by JamesNC (Chaplain) on Apr 18, 2003 at 21:57 UTC |