* Rick Measham [14 Jul 2003 10:19]:
> At 8:01 PM -0400 13/7/03, Ben Bennett wrote:
[...]
> > I also returned additional items in array context, the
> > first was the DT object and the additional items
> > described what was parsed so if the person cared about
> > time only in some cases they could tell them apart from
> > the fully specified items.

> I like this idea .. we'd have something like:

> $hashref = hash_datetime($natural)
> %hash = hash_datetime($natural)

> (Any better suggestions than hash_datetime?)

%data = $class->extract_datetime( $datetime );

Which, I take it, parses $datetime and puts anything of note
in %data. So you'd get something like:

%data = qw(
    hour  23 day_of_year 324 name_of_day Tuesday
    parsing loose
);

Possibly with a datetime key with a DateTime object hanging
off it if appropriate?

Like that?


I think you'd need to have some standardised naming of keys
in there.



cheers,
-- 
Iain.

Reply via email to