[I might join perl6-language some day, but until then, please CC me on all
Time::Object related messages]

<Original from="Bart Lateur">
 On Wed, 2 Aug 2000 08:14:22 +0100 (BST), Matt Sergeant wrote:

>I used to be a C programmer myself (well OK, I was a C++ programmer...),
>but I'd rather any day type "localtime->year" than "(localtime)[5]".

      And what would you type instead of 

              (localtime)[3, 4, 5]

      ? localtime->(day, month, year) ?
</Original>

<Reply>
I'd either leave that as (localtime)[3,4,5] (please read the man page for
Time::Object), or understand that there's absolutely no need to separate
off the variables like that in an object oriented interface:

my ($day, $month, $year) = (localtime)[3,4,5];

becomes:

my $date = localtime;

And use $date->day (or month or year) later when you need to.
</Reply>

-- 
<Matt/>

Fastnet Software Ltd. High Performance Web Specialists
Providing mod_perl, XML, Sybase and Oracle solutions
Email for training and consultancy availability.
http://sergeant.org | AxKit: http://axkit.org

Reply via email to