Crap, my mail client crash and ate part of my reply.

> I was considering a function to do this.  If you look...  I hid a solution in the 
> docs. :)
>
>     my $my_alias = %{ DateTime::TimeZone::Alias->aliases }->{ EST };
>
> I didn't want a function named alias and another one named aliases.  But - how about:

    my $aliased_tz = DateTime::TimeZone::Alias->value( 'EST' );

> Anyways, I'm open to suggestions for a method name.
.
.

> This is specifically why I made the is_N functions public.
>
>     if ( ! DateTime::TimeZone::Alias->is_defined( 'EST' ) ) {
>         DateTime::TimeZone::Alias->add( EST => 'US/Eastern' );
>     }

I really dislike functions that accept an argument then quietly do nothing.  Code 
should "Say what you mean."

>
> IF NOT DEFINED "EST" THEN ADD "EST => 'US/Eastern'".
>
> Self documenting code is highly underrated.

-J

--

Reply via email to