Paul Hoffman wrote:
use relative to => "Enterprise::Framework" => qw(Base Factory);
# loads Enterprise::Framework:Base,
Enterprise::Framework::Factory
Hmm, the last example is equivalent to this:
use relative qw(to Enterprise::Framework Base Factory);
Which might conceivably cause a problem for someone at some point.
You
might consider requiring the string ':to' instead of 'to'.
I agree that this syntax prevents from loading a module named
"to.pm", but I think this is a good trade-off given than adding any
other character will require quoting the word, and I'd like to keep
the syntax as simple as possible. An acceptable compromise it to
write it as C< -to => Root >
As a side note, using find(1) on a mini-CPAN and Google CodeSearch, I
only found 3 modules named "tp.pm" :
- CGI::FormMagick::L10N::to (in MITEL/CGI-FormMagick-0.89.tar.gz)
- DateTime::Locale::to (in DROLSKY/DateTime-Locale-0.35.tar.gz)
- Number::Tolerant::Type::to (in RJBS/Number-Tolerant-1.550.tar.gz)
--
Sébastien Aperghis-Tramoni
Close the world, txEn eht nepO.