Why get that complex? I'd rather:
{ no strict 'refs'; for my $method (qw( seconds minutes hours days weeks months years +)) { *{ $method } = sub { return $_[0]->{ $method } }; *{ 'in_' . $method } = sub { return $_[0]->{ time } / $_[0]->{_table }{ $method } } +} } }
Funny, that ended up quite a bit shorter than I expected.
In reply to Re: Re: RFC: Seconds2English
by chromatic
in thread RFC: Seconds2English
by Limbic~Region
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |