Re: Module naming advice, please.
Thanks for all the suggestions! Given that the Perl module will, for now, be more than just a web client (a portion of it will need to gather data by parsing log files) I think I will go with App::Spoor - with the intent to break off the part that has the webservice functionality into Webservice::Spoor - I will hold off on Spoor:: until I am sure it is not just hurbis talking :). Thanks again! On Wed, 23 Jan 2019 at 21:02, Doug Bell wrote: > > On Jan 23, 2019, at 9:16 AM, Rory McKinley > wrote: > > > > I am developing a hosted application called Spoor. I would like to build > a Perl client module for this application that will (amongst other things) > interact with the Spoor Api. > > > > My current inclination is to call the module Spoor::Client, but that > will mean that I will be creating a new top-level name which I know is > discouraged. Is there a suitable top-level name that I could host my client > under, or would grabbing the Spoor name be ok under these circumstances? > > If it's a web service, I'd say use WWW:: or WebService::. If it's an OSI > Layer 7 protocol like HTTP, I'd go with Net::. If all else fails, > API::Spoor wouldn't be a terrible idea. > > > Doug Bell > d...@preaction.me > -- Rory McKinley Director Cape Fox Consulting (Pty) Ltd Registration No: 2015/388067/07 Director(s): R McKinley
Re: Module naming advice, please.
> On Jan 23, 2019, at 9:16 AM, Rory McKinley wrote: > > I am developing a hosted application called Spoor. I would like to build a > Perl client module for this application that will (amongst other things) > interact with the Spoor Api. > > My current inclination is to call the module Spoor::Client, but that will > mean that I will be creating a new top-level name which I know is > discouraged. Is there a suitable top-level name that I could host my client > under, or would grabbing the Spoor name be ok under these circumstances? If it's a web service, I'd say use WWW:: or WebService::. If it's an OSI Layer 7 protocol like HTTP, I'd go with Net::. If all else fails, API::Spoor wouldn't be a terrible idea. Doug Bell d...@preaction.me
Re: Module naming advice, please.
There's APP:: - e.g. APP::Spoor::API & APP::Spoor::Client On 23-Jan-19 10:16, Rory McKinley wrote: > Hello > > I am developing a hosted application called Spoor. I would like to > build a Perl client module for this application that will (amongst > other things) interact with the Spoor Api. > > My current inclination is to call the module Spoor::Client, but that > will mean that I will be creating a new top-level name which I know is > discouraged. Is there a suitable top-level name that I could host my > client under, or would grabbing the Spoor name be ok under > these circumstances? > > Thanks in advance > > Rory > > -- > Rory McKinley > Director > Cape Fox Consulting (Pty) Ltd > Registration No: 2015/388067/07 > Director(s): R McKinley signature.asc Description: OpenPGP digital signature
Re: Module naming advice
David Golden wrote: Tim Bunce wrote: On Fri, May 26, 2006 at 11:26:22PM +0200, David Landgren wrote: Jeff Lavallee wrote: of the SOAP::Lite details. Currently, I'm planning on calling it Yahoo::Marketing. Yahoo::Marketing.pm itself would just serve as a place holder (with POD) for the time being, with all the meat under that namespace (for example, Yahoo::Marketing::AccountService, Yahoo::Marketing::Account, etc). The POD-in-progress for Yahoo::Marketing is below. Any thoughts/comments/suggestions about the intended namespace would be greatly appreciated. There is already at least one module in WWW::Yahoo::*. I would suggest slotting your modules in at that level as well. The WWW:: space is overcrowded and confused. The WebService:: namespace was created for modules interfacing with web sercices. So WebService::Yahoo::* seems like the best home. I don't think that WebService::Yahoo::* is any clearer than Yahoo::*, so my personal preference would be to avoid that if it's new. If there is already a convention for where to find Yahoo interfaces, I would follow that, even if that's sub-optimal. With most of CPAN being accessed by search rather than by category, as long as Yahoo is in the module name, it'll be easy enough to find. The other consideration is that WebService::Yahoo::Marketing::[whatever] starts to get pretty unwieldy. The Yahoo:: namespace is already in use and in the case of Yahoo::Search, it uses web services as well, so it does seem that a precedent of some sort has been set, which I'm inclined to follow. Thanks, Jeff
Re: Module naming advice
On Fri, May 26, 2006 at 11:26:22PM +0200, David Landgren wrote: Jeff Lavallee wrote: Hi all, before I upload a new module, I thought I'd make sure the namespace I intend to use makes sense. I've been working on a set of modules to make interacting with the next generation of Yahoo's marketing web services easier. The modules insulate the user from a lot of the SOAP::Lite details. Currently, I'm planning on calling it Yahoo::Marketing. Yahoo::Marketing.pm itself would just serve as a place holder (with POD) for the time being, with all the meat under that namespace (for example, Yahoo::Marketing::AccountService, Yahoo::Marketing::Account, etc). The POD-in-progress for Yahoo::Marketing is below. Any thoughts/comments/suggestions about the intended namespace would be greatly appreciated. There is already at least one module in WWW::Yahoo::*. I would suggest slotting your modules in at that level as well. The WWW:: space is overcrowded and confused. The WebService:: namespace was created for modules interfacing with web sercices. So WebService::Yahoo::* seems like the best home. Tim.
Re: Module naming advice
Tim Bunce wrote: On Fri, May 26, 2006 at 11:26:22PM +0200, David Landgren wrote: Jeff Lavallee wrote: of the SOAP::Lite details. Currently, I'm planning on calling it Yahoo::Marketing. Yahoo::Marketing.pm itself would just serve as a place holder (with POD) for the time being, with all the meat under that namespace (for example, Yahoo::Marketing::AccountService, Yahoo::Marketing::Account, etc). The POD-in-progress for Yahoo::Marketing is below. Any thoughts/comments/suggestions about the intended namespace would be greatly appreciated. There is already at least one module in WWW::Yahoo::*. I would suggest slotting your modules in at that level as well. The WWW:: space is overcrowded and confused. The WebService:: namespace was created for modules interfacing with web sercices. So WebService::Yahoo::* seems like the best home. I don't think that WebService::Yahoo::* is any clearer than Yahoo::*, so my personal preference would be to avoid that if it's new. If there is already a convention for where to find Yahoo interfaces, I would follow that, even if that's sub-optimal. With most of CPAN being accessed by search rather than by category, as long as Yahoo is in the module name, it'll be easy enough to find. Regards, David Golden
Re: Module naming advice
Jeff Lavallee wrote: Hi all, before I upload a new module, I thought I'd make sure the namespace I intend to use makes sense. I've been working on a set of modules to make interacting with the next generation of Yahoo's marketing web services easier. The modules insulate the user from a lot of the SOAP::Lite details. Currently, I'm planning on calling it Yahoo::Marketing. Yahoo::Marketing.pm itself would just serve as a place holder (with POD) for the time being, with all the meat under that namespace (for example, Yahoo::Marketing::AccountService, Yahoo::Marketing::Account, etc). The POD-in-progress for Yahoo::Marketing is below. Any thoughts/comments/suggestions about the intended namespace would be greatly appreciated. There is already at least one module in WWW::Yahoo::*. I would suggest slotting your modules in at that level as well. David -- hope still, a little resistance always maybe stubborn tiny lights vs. clustering darkness forever ok?
Re: Module naming advice
A. Pagaltzis wrote: * Jenda Krynicky [EMAIL PROTECTED] [2005-01-05 01:28]: Has anyone ever seen a module with a space in the name? If not we might just as well use use aka 'Really::Long::Module::Name as MName' qw(foo bar baz); How about this? use aka [ 'Really::Long::Module::Name' = 'Name' ] qw( foo bar baz ); Regards, My 5 words... use aka Name Really::Lond::Module::Name qw(foo bar baz) -- Alberto Simões - Departamento de Informática - Universidade do Minho ,,__ .. .. / o._) .---. /--'/--\ \-'||...' '. /\_/ / | .' '..' '-. .'\ \__\ __.'.' .' ì-._ )\ | )\ | _.' // \\ // \\ ||_ \\|_ \\_ Perl Monger mrf '--' '--'' '--'www.perl-hackers.net
Re: Module naming advice
* Alberto Manuel Brandao Simoes [EMAIL PROTECTED] [2005-01-06 21:19]: My 5 words... use aka Name Really::Lond::Module::Name qw(foo bar baz) Except that's not valid syntax, and the version which would be has already been discussed and dismissed. Regards, -- #Aristotle *AUTOLOAD=*_;sub _{s/(.*)::(.*)/print$2,(,$\/, )[defined wantarray]/e;$1} Just-another-Perl-hacker;
Re: Module naming advice
I don't understand what's being contemplated here. I think we're talking about recreating Package::Alias, which is essentially sugar around use really::long::name::ending::bar; BEGIN { *bar:: = \*really::long::name::ending::bar:: } after which the methods in RLNEB can be referred to with the much shorter bar::widget($arg1, $arg2); How does the contemplated module differ from Package::Alias?
Re: Module naming advice
On Thu, 2005-01-06 at 20:08 -0600, David Nicol wrote: I don't understand what's being contemplated here. I think we're talking about recreating Package::Alias, which is essentially sugar around use really::long::name::ending::bar; BEGIN { *bar:: = \*really::long::name::ending::bar:: } after which the methods in RLNEB can be referred to with the much shorter bar::widget($arg1, $arg2); How does the contemplated module differ from Package::Alias? It's similar, but different. The proposed module does not alias the package at the level that Package::Alias does, i.e. by messing around with the stash and globs. What it does is first require the package, then insert a constant sub into the caller's package which returns the long name of the package. This makes it easier to call class methods, but does not allow calls of the type you show above. Thus: use aka 'Really::Long::Package::Name' = ShortName; # equiv to use constant ShortName = Really::Long::Package::Name; ShortName-new(...); # works ShortName::new(...); # doesn't work print $ShortName::VERSION; # doesn't work The advantage of this over the more low-level Package::Alias method is that objects are blessed into the correct path. After package Foo; *ShortName:: = \*Really::Long::Package::Name::; my $foo = ShortName-new(...); $foo would be blessed into Foo::Shortname, or possibly just ShortName instead of its proper package. It really is a very useful module; I've been using it for almost a year and now can't live without it. -- Bruce J Keeler [EMAIL PROTECTED]
RE: Module naming advice
Title: RE: Module naming advice Which is my problem with 'alias.' Case-insensitive systems will happily load a module with incorrect case (after loading, though, using the name with incorrect case will cause problems). Which module would get loaded? Assuming they are both installed into site/lib then whichever one was installed last. :-) Yves
Re: Module naming advice
On Jan 4, 2005, at 6:06 PM, Ovid wrote: --- Eric Wilhelm [EMAIL PROTECTED] wrote: Me too, except for how it reads in the 'use' statement. use aka 'Really::Long::Module::Name'; Yeah, that bugs me too. Still, aka.pm is the name I lean toward. It any case, it seems that 'alias.pm' might get confused with 'Alias.pm'. Which is my problem with 'alias.' I think aka doesn't read very well at all. If I expand use aka 'Foo::Bar' or use aka 'Foo::Bar' as 'Baz' out in my brain, it'll be use also known as Foo::Bar or use also known as 'Foo::Bar' as 'Baz', which is nonsensical. It would seem better to use a noun there, perhaps something like use alias 'Baz' for 'Foo::Bar', or even just exploit perl's natural pairing syntax: use alias 'Foo::Bar' = 'Baz'. In the case of this module, interface is really everything, of course. If I were you I'd really try to nail it before pushing it to release. -Ken
Re: Module naming advice
On Tue, 4 Jan 2005 12:49:16 -0800 (PST), Ovid [EMAIL PROTECTED] wrote: I'm about to release Aliased to the CPAN. [ . . . . ] Basically, when you have long package names, it can be cumbersome to retype the package name all the time. This module allows you to skip that if the subroutines are called as methods. It exports a subroutine into your namespace that is the desired alias for the module. Having used something similar in a large system, I found that having this feature became quite addictive. [ . . . . ] Is Aliased a good name? Is aliased better? Am I overlooking anything? Are you aware of Alias.pm? - Kurt
Re: Module naming advice
--- Kurt Starsinic [EMAIL PROTECTED] wrote: On Tue, 4 Jan 2005 12:49:16 -0800 (PST), Ovid [EMAIL PROTECTED] wrote: I'm about to release Aliased to the CPAN. [ . . . . ] Basically, when you have long package names, it can be cumbersome to retype the package name all the time. This module allows you to skip that if the subroutines are called as methods. It exports a subroutine into your namespace that is the desired alias for the module. Having used something similar in a large system, I found that having this feature became quite addictive. [ . . . . ] Is Aliased a good name? Is aliased better? Am I overlooking anything? Are you aware of Alias.pm? I am aware of that module. It does something completely different from mine, so I'm not worried about duplicating functionality. However, I do realize the name can cause some confusion. I welcome other suggestions. I had briefly considered module.pm or class.pm, but I envisioned howls of protests: use class Really::Long::Class::Name; my $o = Name-new; However, I do think it's more clear. Cheers, Ovid = Silence is Evil http://users.easystreet.com/ovid/philosophy/decency.html Ovid http://www.perlmonks.org/index.pl?node_id=17000 Web Programming with Perl http://users.easystreet.com/ovid/cgi_course/
RE: Module naming advice
My only quibble is that alias is 'less cumbersome' than aliased---sadly already used... --hsm p.s. nice idea!! -Original Message- From: Ovid [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 04, 2005 1:49 PM To: module-authors@perl.org Subject: Module naming advice Hi all, I'm about to release Aliased to the CPAN. Yeah, it's a root level name, but it will soon become clear why it needs to be short. SYNOPSIS: use Aliased 'Really::Long::Module::Name'; use Aliased 'Really::Long::Conflicting::Module::Name' as MName; use Aliased 'Another::Silly::Example' import = [qw/foo bar baz/]; # my $name = Really::Long::Module::Name-new; my $name = Name-new; # my $mname = Really::Long::Conflicting::Module::Name-new my $mname = MName-new; # my $wibble = Another::Silly::Example-constructor. my $wibble = Example-constructor; Basically, when you have long package names, it can be cumbersome to retype the package name all the time. This module allows you to skip that if the subroutines are called as methods. It exports a subroutine into your namespace that is the desired alias for the module. Having used something similar in a large system, I found that having this feature became quite addictive. Since this affects compile-time behavior, it seemed more appropriate to think of this as a pragma and have use aliased but I know that some frown on that (of course, Ingy released only and I didn't hear any complaints.) Is Aliased a good name? Is aliased better? Am I overlooking anything? Cheers, Ovid = Silence is Evil http://users.easystreet.com/ovid/philosophy/decency.html Ovid http://www.perlmonks.org/index.pl?node_id=17000 Web Programming with Perl http://users.easystreet.com/ovid/cgi_course/
Re: Module naming advice
On Tue, 2005-01-04 at 12:49 -0800, Ovid wrote: Hi all, I'm about to release Aliased to the CPAN. Yeah, it's a root level name, but it will soon become clear why it needs to be short. [...] I've always felt that this one should have a lowercase name, since it's rather pragma-ish. Are pragmas allowed outside of the core Perl distribution? Maybe it should be submitted as a core pragma, actually. It's a really lightweight beast, and very useful. Would certainly get my vote. -- Bruce J Keeler [EMAIL PROTECTED]
Re: Module naming advice
On Jan 4, 2005, at 2:47 PM, Bruce J Keeler wrote: I've always felt that this one should have a lowercase name, since it's rather pragma-ish. Are pragmas allowed outside of the core Perl distribution? Maybe it should be submitted as a core pragma, actually. It's a really lightweight beast, and very useful. Would certainly get my vote. I agree that it should be lowercased; yes, there are modules on CPAN that look like pragmas (such as only). I personally would prefer, however, that the name tell me that it's doing something more than loading a class; class and module don't do that. Here are some other options: * alias (too close to Aliased?) * nickname * moniker * pseudonym * aka * anonym * handle (not a file handle, though, might be confusing) * label * term * shortcut I kind of like aka, actually. But nickname, moniker, and shortcut are all good, too. Just my $0.02. Regards, David
Re: Module naming advice
aka is cool. I'll throw a few suggestions: * mask * camo * pose * cover * veil * guise But yeah, aka is probly the best bet. On Tue, Jan 04, 2005 at 02:55:08PM -0800, David Wheeler wrote: On Jan 4, 2005, at 2:47 PM, Bruce J Keeler wrote: I've always felt that this one should have a lowercase name, since it's rather pragma-ish. Are pragmas allowed outside of the core Perl distribution? Maybe it should be submitted as a core pragma, actually. It's a really lightweight beast, and very useful. Would certainly get my vote. I agree that it should be lowercased; yes, there are modules on CPAN that look like pragmas (such as only). I personally would prefer, however, that the name tell me that it's doing something more than loading a class; class and module don't do that. Here are some other options: * alias (too close to Aliased?) * nickname * moniker * pseudonym * aka * anonym * handle (not a file handle, though, might be confusing) * label * term * shortcut I kind of like aka, actually. But nickname, moniker, and shortcut are all good, too. Just my $0.02. Regards, David
Re: Module naming advice
David Wheeler wrote: On Jan 4, 2005, at 2:47 PM, Bruce J Keeler wrote: I've always felt that this one should have a lowercase name, since it's rather pragma-ish. Are pragmas allowed outside of the core Perl distribution? Maybe it should be submitted as a core pragma, actually. It's a really lightweight beast, and very useful. Would certainly get my vote. I agree that it should be lowercased; yes, there are modules on CPAN that look like pragmas (such as only). I personally would prefer, however, that the name tell me that it's doing something more than loading a class; class and module don't do that. Here are some other options: * alias (too close to Aliased?) * nickname * moniker * pseudonym * aka * anonym * handle (not a file handle, though, might be confusing) * label * term * shortcut I kind of like aka, actually. But nickname, moniker, and shortcut are all good, too. There is Package::Alias[1]. Does the same thing, but I haven't used it. I like the idea of it being a pragma; 'aka' seems kinda perlish. It'd be nice if this was supported in perl, so it would be possible to alias entire namespaces use aka 'Apache2::Apache::' as 'Apache::'; # ;-) Which would all all modules in the first namespace to be addressed as if they were in the second, including munging %INC so it does the right thing. 1. http://search.cpan.org/dist/Package-Alias/
Re: Module naming advice
# The following was supposedly scribed by # David Wheeler # on Tuesday 04 January 2005 04:55 pm: I agree that it should be lowercased; yes, there are modules on CPAN that look like pragmas (such as only). I personally would prefer, however, that the name tell me that it's doing something more than loading a class snip I kind of like aka, actually. Me too, except for how it reads in the 'use' statement. use aka 'Really::Long::Module::Name'; use aka 'Really::Long::Conflicting::Module::Name' as MName; use aka 'Another::Silly::Example' import = [qw/foo bar baz/]; That looks like 'use' is Also Known As Really::Long::Module::Name, when what we really mean (and therefore want to say) is more like: use Really::Long::Module::Name aka Name; Of course, the 'use' mechanism isn't able to do this at present (that is: pragmas don't even work this way), so maybe one of the other names is in order. 'alias' as an adverb doesn't work in that order either, but works as a verb, which is sort-of where you're stuck unless you build this functionality into the use() function. Of course, alias as a verb isn't in the dictionary, we geeks just read it that way because of the bash function. It any case, it seems that 'alias.pm' might get confused with 'Alias.pm'. Now I'm strapped to come-up with a verb which doesn't sound so nounish. Consulting the resident linguist (aka wife) results in 'dub' (as in 'I dub thee'), so I'll throw that out as a suggestion. use dub 'Really::Long::Module::Name' as 'Name'; That also seems to work well as an alternative to the use function rather than a module or pragma (yeah, perl needs more functions in the core.) dub Long::Name; dub Long::Name as Name; As for the interface, I really like the 'as' part, but the 'import = [qw(stuff)]' seems clunky. Is there a reason that this syntax can't work: use dub 'Long::Name' qw(foo bar baz); use dub 'Long::Name' as 'Name' qw(foo bar baz); --Eric -- Chess is a foolish expedient for making idle people believe they are doing something very clever when they are only wasting their time. --George Bernard Shaw
Re: Module naming advice
--- Eric Wilhelm [EMAIL PROTECTED] wrote: Me too, except for how it reads in the 'use' statement. use aka 'Really::Long::Module::Name'; Yeah, that bugs me too. Still, aka.pm is the name I lean toward. It any case, it seems that 'alias.pm' might get confused with 'Alias.pm'. Which is my problem with 'alias.' Case-insensitive systems will happily load a module with incorrect case (after loading, though, using the name with incorrect case will cause problems). Which module would get loaded? As for the interface, I really like the 'as' part, but the 'import = [qw(stuff)]' seems clunky. Is there a reason that this syntax can't work: use dub 'Long::Name' qw(foo bar baz); use dub 'Long::Name' as 'Name' qw(foo bar baz); That fails because if the real module accepts 'as' in the import list, I have no way to disambiguate things. As a convenience, if you only have a single import item, you can do this: use aka 'Really::Long::Module::Name' import = 'thingy'; Cheers, Ovid = Silence is Evil http://users.easystreet.com/ovid/philosophy/decency.html Ovid http://www.perlmonks.org/index.pl?node_id=17000 Web Programming with Perl http://users.easystreet.com/ovid/cgi_course/
Re: Module naming advice
On Tue, 2005-01-04 at 18:29 -0500, Randy W. Sims wrote: There is Package::Alias[1]. Does the same thing, but I haven't used it. Upon a quick glance, this does a similar thing but via a different mechanism. Ovid's module installs a constant sub into the caller's namespace which returns the long name of the module. All this is really good for is calling class methods. use Aliased 'Long::Module::Name' as 'Name'; # i.e. use constant Name = 'Long::Module::Name'; Name-new(); # Works print $Name::VERSION; # Doesn't work. Package::Alias sounds like it messes with the stash, something like $::{'Name::'} = $::{'Long::Module::Name::'} if I recall the syntax correctly. The downside to this approach is that objects created via an aliased package name will be blessed into the aliased package name rather than the original one, which could confuse things. I like the idea of it being a pragma; 'aka' seems kinda perlish. It'd be nice if this was supported in perl, so it would be possible to alias entire namespaces use aka 'Apache2::Apache::' as 'Apache::'; # ;-) Which would all all modules in the first namespace to be addressed as if they were in the second, including munging %INC so it does the right thing. This is a completely different problem, requiring a different solution. For the record, I still like the name 'aliased', partly because I'm used to it. -- Bruce J Keeler [EMAIL PROTECTED]
Re: Module naming advice
From: Ovid [EMAIL PROTECTED] --- Eric Wilhelm [EMAIL PROTECTED] wrote: Me too, except for how it reads in the 'use' statement. use aka 'Really::Long::Module::Name'; Yeah, that bugs me too. Still, aka.pm is the name I lean toward. Agreed. As for the interface, I really like the 'as' part, but the 'import = [qw(stuff)]' seems clunky. Is there a reason that this syntax can't work: use dub 'Long::Name' qw(foo bar baz); use dub 'Long::Name' as 'Name' qw(foo bar baz); That fails because if the real module accepts 'as' in the import list, I have no way to disambiguate things. As a convenience, if you only have a single import item, you can do this: use aka 'Really::Long::Module::Name' import = 'thingy'; Has anyone ever seen a module with a space in the name? If not we might just as well use use aka 'Really::Long::Module::Name as MName' qw(foo bar baz); Eric Wilhelm [EMAIL PROTECTED] suggested: Now I'm strapped to come-up with a verb which doesn't sound so nounish. Consulting the resident linguist (aka wife) results in 'dub' (as in 'I dub thee'), so I'll throw that out as a suggestion. use dub 'Really::Long::Module::Name' as 'Name'; Sorry, that would not work for me. I found it in the dictionary, but I've never heard/seen it. And I doubt other foreigners did either, may be mistaken. Actually, what about renamed? use renamed 'Really::Long::Module::Name as MName' qw(foo bar baz); Jenda = [EMAIL PROTECTED] === http://Jenda.Krynicky.cz = When it comes to wine, women and song, wizards are allowed to get drunk and croon as much as they like. -- Terry Pratchett in Sourcery
Re: Module naming advice
David Wheeler wrote: I agree that it should be lowercased; yes, there are modules on CPAN that look like pragmas (such as only). I personally would prefer, however, that the name tell me that it's doing something more than loading a class; class and module don't do that. However, this code reads very well: use module 'Foo::Bar' as 'Bar'; use package 'Foo::Bar' as 'Bar'; And this does not read as well (at least, in English): use aka 'Foo::Bar' as 'Bar'; My suggestion; use aliasing to 'Bar', 'Foo::Bar'; With the upside that aliasing also clearly states what the module does. -- Sam Vilain, sam /\T vilain |T net, PGP key ID: 0x05B52F13 (include my PGP key ID in personal replies to avoid spam filtering)
Re: Module naming advice
--- Sam Vilain [EMAIL PROTECTED] wrote: However, this code reads very well: use module 'Foo::Bar' as 'Bar'; use package 'Foo::Bar' as 'Bar'; 'package' is a reserved word, so I won't use that. 'module' is worse than 'class' because 'class' at least let's us know that this pragma is only for OO modules. And this does not read as well (at least, in English): use aka 'Foo::Bar' as 'Bar'; Yeah, I really don't like it. My suggestion; use aliasing to 'Bar', 'Foo::Bar'; With the upside that aliasing also clearly states what the module does. That fails because it makes the common case more difficult: use aliasing Really::Long::Class:Name; # or use aliasing Really::Long::Class:Name, as = CName; However, I do like the name aliasing.pm Anyone else? It's not perfect, but the one that reads the most naturally class, seems to not be favored by people. Cheers, Ovid = Silence is Evil http://users.easystreet.com/ovid/philosophy/decency.html Ovid http://www.perlmonks.org/index.pl?node_id=17000 Web Programming with Perl http://users.easystreet.com/ovid/cgi_course/
Re: Module naming advice
# The following was supposedly scribed by # Jenda Krynicky # on Tuesday 04 January 2005 06:28 pm: Has anyone ever seen a module with a space in the name? If not we might just as well use use aka 'Really::Long::Module::Name as MName' qw(foo bar baz); Right. No, it's not even possible to have a space in a module name, so your suggestion gives Ovid an easy ($new, $old) = split(/\s+as\s+/, $arg); to work-out which as is which. Eric Wilhelm [EMAIL PROTECTED] suggested: 'dub' (as in 'I dub thee'), so I'll throw that out as a suggestion. Sorry, that would not work for me. I found it in the dictionary, but I've never heard/seen it. And I doubt other foreigners did either, may be mistaken. Hmm. Never seen/heard/read anything about knights/knighthood? What about 'dubya'? Have you heard of him? (so-named for his tendency to assign nicknames to members of his cabinet, foreign ministers, etc.) Oh well. Dreams and kittens... --Eric -- Matter will be damaged in direct proportion to its value. --Murphy's Constant
Re: Module naming advice
Ovid [EMAIL PROTECTED] writes: [...] That fails because it makes the common case more difficult: use aliasing Really::Long::Class:Name; # or use aliasing Really::Long::Class:Name, as = CName; However, I do like the name aliasing.pm Anyone else? It's not perfect, but the one that reads the most naturally class, seems to not be favored by people. What about something like 'shortname': use shortname Really::Long::Class::Name; use shortname CName = Really::Long::Class::Name; or use shortname CName for Really::Long::Class::Name; It's confusing to have unrelated modules called Alias and aliasing. ScottG.