This is a message that Ben sent to be privately. With his permission I'm forwarding it to the list along with my reply.
Thanks for your comments Ben. -J -- ---------- Forwarded message ---------- Date: Thu, 12 Jun 2003 22:12:46 -0400 From: Ben Bennett <[EMAIL PROTECTED]> To: Joshua Hoblitt <[EMAIL PROTECTED]> Subject: Re: [announce] DateTime::TimeZone::Alias 0.01 No prob :-) And to deluge you with yet another message about this... Is it a problem that it affects the TZ behavior across all modules? I am not sure how you would get around that with the current TZ interface (you would need some way to get a "TZ factory" object that you would use as a parameter to DT... but then anything trying to make a DT internally would need the factory and that gets nasty). I 'spose that the current way makes a lot of sense as long as people don't overwrite existing items. Perhaps it would be nice to provide a way to test if a given alias is defined (and get the value) (although I guess DT::TZ::links gives you that, maybe just mentioning it in the pod is enough). It may also be nice (but probably overkill) to have a method that does a conditional set, so you can choose to say: DT::TZ::Alias->add("GMT" => "America/New_York") or die "Error: tried to overwrite existing TZ alias..."; Intenally add would do a set with the rules that if the alias existed and had a different value from the new one _or_ the new alias name was one of the base timezones then it would throw an error. What happens if I try to alias EST to US/Eastern? Will that work? (i.e. what if I alias to an existing alias?) My above proposal doesn't correctly handle removing an alias... for instance if I have: --- package Foo; DT::TZ::Alias->add(EST => 'US/Eastern'); bar(); my $dt = DateTime->now(time_zone => 'EST'); # ERROR, EST is gone... package Bar; sub bar { DT::TZ::Alias->add(EST => 'US/Eastern'); # stuff DT::TZ::Alias->delete('EST'); } --- On the other hand, perhaps people shouldn't clean up stuff. Otherwise you have to start tracking which package added what and not actually doing the deletion unless all calling packages call remove(*)... except when you really want to do the deletion from another package for a good reason. I think that way lies madness. (Or whatever the analog of add would be) Anyway, thanks for bearing with my babbling... I really do like the module. -ben On Thu, Jun 12, 2003 at 03:54:58PM -1000, Joshua Hoblitt wrote: > Doh, I made the release before my morning coffee. :) > > On Thu, 12 Jun 2003, Ben Bennett wrote: > > > I think you forgot to change the test after renaming del. > > > > -ben > > > > [EMAIL PROTECTED]:~/perl/dt/DateTime-TimeZone-Alias-0.01> make test > > /usr/bin/perl ./Build test > > lib/DateTime/TimeZone/Alias.pm -> blib/lib/DateTime/TimeZone/Alias.pm > > lib/DateTime/TimeZone/Alias.pod -> blib/lib/DateTime/TimeZone/Alias.pod > > t/01_load......ok > > t/02_import....ok > > t/03_set.......ok > > t/04_del.......ok 1/2Can't locate object method "del" via package > > "DateTime::TimeZone::Alias" at t/04_del.t line 15. > > # Looks like you planned 2 tests but only ran 1. > > # Looks like your test died just after 1. > > t/04_del.......dubious > > Test returned status 255 (wstat 65280, 0xff00) > > DIED. FAILED test 2 > > Failed 1/2 tests, 50.00% okay > > Failed Test Stat Wstat Total Fail Failed List of Failed > > -------------------------------------------------------------------------------t/04_del.t > > 255 65280 2 1 50.00% 2 > > Failed 1/4 test scripts, 75.00% okay. 1/10 subtests failed, 90.00% okay. > > make: *** [test] Error 2 > > > > > > On Thu, Jun 12, 2003 at 10:27:31AM -1000, Joshua Hoblitt wrote: > > > Released to CPAN. > > > > > > Available immediately from: > > > > > > http://kolea.ifa.hawaii.edu/~jhoblitt/pm/DateTime-TimeZone-Alias-0.01.tar.gz > > > > > > Changes since 0.01pre1 > > > > > > Renamed del to remove on Dave's advice. > > > > > > Cheers, > > > > > > -J > > > > > > -- > > > > -J > > --