> > 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.
Precisely. Hence my previous suggestion:
$day = localtime; # return date string in SCALAR context
$year = localtime->{year}; # return hash ref in HASHREF context
(@bits) = localtime; # return list in LIST context
This just relies on extensions to the context mechanism which I will RFC RSN
when I propose the new want() built-in to replace wantarray().
Damian
- Re: wantarray() should be named wantlist(... Jonathan Scott Duff
- Re: wantarray() should be named wantl... Clayton Scott
- Re: wantarray() should be named ... Jonathan Scott Duff
- Re: wantarray() should be na... Nathan Wiger
- Re: wantarray() should be na... skud
- Re: wantarray() should be named wantlist(... Graham Barr
- Re: wantarray() should be named wantlist() (... Damian Conway
- Re: wantarray() should be named wantlist(... Tad McClellan
- Re: date interface (was Re: perl6 requirements, o... Tom Christiansen
- Re: date interface (was Re: perl6 requirement... Matt Sergeant
- Damian Conway
