On Thu, 3 Aug 2000, Tom Christiansen wrote:
> >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.
>
> But people *like* to be able to put things in simple variables.
> It's more convenient to type $day than $date->day for repeated
> usage.
I hope you're not being purposely obtuse... The original interface
remains. If you want to use it that way please do so. Time::Object checks
wantarray() and does the right thing. In a string context it stringifies
to the equivalent of scalar CORE::localtime.
I have a number of projects where I've dropped Time::Object in only to
migrate parts of the code when I've wanted to, and left others using the
original interface.
--
<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