SPUG: How to deal with same name packages?
Colin Meyer
cmeyer at helvella.org
Mon Jan 14 17:05:35 CST 2002
On Mon, Jan 14, 2002 at 02:24:15PM -0800, c k wrote:
> Is there a way to deal with same name
> packages/modules/classes/objects in perl?
>
> I created a Link.pm and used that with LWP in a main
> script (e.g., put use Link; and use LWP; near the
> top). I believe my Link.pm is clashing with another
> module named Link.pm in LWP, because when I change my
> Link.pm to Lynk.pm things work fine.
>
> Besides changing my module name from Link.pm to
> Lynk.pm, is there another way to deal with same name
> packages in Perl? For example, in C you can do this,
When using generic names for modules, I like to prefix the name with
another namespace. If your module is for personal use, then you might
use CK::Link. That keeps your module clear of interference from anyone
else who might like the desirable name of 'Link'. (Think: HTML::Parser,
XML::Parser, YAML::Parser, Perl6::Parser, CMEYER::SuperBogus::Parser).
Have fun,
-C.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
POST TO: spug-list at pm.org PROBLEMS: owner-spug-list at pm.org
Subscriptions; Email to majordomo at pm.org: ACTION LIST EMAIL
Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest
Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/
More information about the spug-list
mailing list