I just realized that won't allow you specify a top level namespace. Probably not an issue for most people. hmmm...
-J -- On Thu, 29 May 2003, Joshua Hoblitt wrote: > Dave, > > Here is a small patch to allow arbitrary namespaces to be passed to DT::Language. > This is useful for modules that want to include their own DT::Language subclasses or > want to generate information at runtime. > > Cheers, > > -J > > -- > Index: lib/DateTime/Language.pm > =================================================================== > RCS file: /cvsroot/perl-date-time/modules/DateTime.pm/lib/DateTime/Language.pm,v > retrieving revision 1.15 > diff -u -r1.15 Language.pm > --- lib/DateTime/Language.pm 27 Apr 2003 23:40:47 -0000 1.15 > +++ lib/DateTime/Language.pm 30 May 2003 00:05:28 -0000 > @@ -77,7 +77,14 @@ > $real_lang = $lang; > } > > - my $real_class = "DateTime::Language::$real_lang"; > + my $real_class; > + > + if ( $lang =~ /::/ ) { > + $real_class = $lang; > + } else { > + $real_class = "DateTime::Language::$real_lang"; > + } > + > eval "use $real_class"; > die $@ if $@; > > -- > >