Hi everybody,
I'm trying to make some custom locales and I've been having trouble getting the 
register method to work. Even using the example code:

  DateTime::Locale->register
    ( id           => 'en_GB_RIDAS',
      en_language  => 'English',
      en_territory => 'United Kingdom',
      en_variant   => 'Ridas Custom Locale',
    );

gives me:

  Can't use string ("id") as a HASH ref while "strict refs" in use at 
/usr/lib/perl5/site_perl/5.8.0/DateTime/Locale.pm line 37.

Lines 35-37 being:

    foreach my $l ( ref $_[0] ? @{ $_[0] } : $_[0] )
    {
        my @p = %$l;

Only 'id' is being used to create @p and perl is getting very confused. Shouldn't $l 
be set to all items in @_ and not just $_[0]? Line 35 would then be something like 
(untested):

    foreach my $l ( ref $_[0] ? @{ $_[0] } : @_ )


The documentation also mentions that the id method is required for new custom locales, 
where abouts is id defined for the default locales?

Cheers,
David Hood

Reply via email to