On Oct 6, 2007, at 1:27 PM, Sébastien Aperghis-Tramoni wrote:
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)
If you really wanted a ::to you could just rearrange the order and say:
use relative qw(Enterprise::Framework Base Factory to);
The only thing it couldn't support is a single pkg called ::to.
Chris