At 12:09 PM 8/9/00 -0600, Nathan Torkington wrote:
>I want the core to stay useful but not complex.  If localtime returned
>a hashref in scalar context, that'd be enough for me:
>
>   $now = localtime;
>   print $now->{MONTH};
>   print $now->{YEAR};           # already has 1900 added onto it :-)
>   print $now->{INTEGER};        # epoch seconds value
>
>To get what is now scalar localtime, you'd say
>
>   print localtime->{STRING};

I'd just as soon that was scalar(localtime)--if we're going to do this, 
then we should do it so the short-hand format's convenient and useful.

Which sort of argues for localtime in a numeric scalar context to return 
epoch seconds, in a string scalar context to return a time string, and in a 
plain scalar context a hashref. (or mini-object, or tied thingamabob, or 
whatever) Of course, we're trying to kill $! which does that, which is a 
counter-argument...

>In list context it would return a simple list of values as it does now.
>
>RFC 48 is way too complex for my liking.  In particular it expects
>Perl to be able to distinguish between assignment to array and to a
>hash.
>
>I smell a counter-RFC, or at least a mailing list on which to thrash
>this out.
>
>Nat


                                        Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to