Re: RFC: relative.pm

2007-10-09 Thread Adrian Howard
On 9 Oct 2007, at 11:19, Jonathan Rockway wrote: Andy Armstrong wrote: On 9 Oct 2007, at 11:05, Jonathan Rockway wrote: What a fucking joke. If it's a joke you should use Comic Sans so everyone /knows/ it's funny. No no, Comic Sans is for presentations to the shareholders! Somebody wh

Re: RFC: relative.pm

2007-10-09 Thread Jonathan Rockway
Andy Armstrong wrote: > On 9 Oct 2007, at 11:05, Jonathan Rockway wrote: >> What a fucking joke. > > If it's a joke you should use Comic Sans so everyone /knows/ it's funny. > No no, Comic Sans is for presentations to the shareholders! Regards, Jonathan Rockway signature.asc Description: Ope

Re: RFC: relative.pm

2007-10-09 Thread Andy Armstrong
On 9 Oct 2007, at 11:05, Jonathan Rockway wrote: What a fucking joke. If it's a joke you should use Comic Sans so everyone /knows/ it's funny. -- Andy Armstrong, Hexten

Re: RFC: relative.pm

2007-10-09 Thread Jonathan Rockway
Pearce, Martyn wrote: >> -Original Message- >> From: Jonathan Rockway [mailto:[EMAIL PROTECTED] >> >> Pearce, Martyn wrote: >> >>> It is? How so? >>> >> Don't top-post. It ruins the flow for people trying to reply to you. >> > > Fair point, apologies. I blame outlook,

Re: RFC: relative.pm

2007-10-09 Thread Sébastien Aperghis-Tramoni
Eric Wilhelm wrote: > Anyway, this is an unchecked eval, and always-on. > ># import the symbols from the loaded module into the caller module >eval qq{ package $caller; $module->import }; Indeed. Thanks for spotting this. -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.

RE: RFC: relative.pm

2007-10-09 Thread Pearce, Martyn
>-Original Message- >From: Jonathan Rockway [mailto:[EMAIL PROTECTED] > >Pearce, Martyn wrote: >> It is? How so? >> > >Don't top-post. It ruins the flow for people trying to reply to you. Fair point, apologies. I blame outlook, which I use only under protest. >To answer your quest

Re: RFC: relative.pm

2007-10-09 Thread Eric Wilhelm
# from A. Pagaltzis # on Monday 08 October 2007 22:44: >* Eric Wilhelm <[EMAIL PROTECTED]> [2007-10-09 01:40]: >> The brackets are clunky though, particularly with the qw() >> inside them. >> >> use relative Third => -import => qw(with some args); > >You mean `-import =>` is less clunky than `[]`

Re: RFC: relative.pm

2007-10-08 Thread A. Pagaltzis
* Philippe Bruhat (BooK) <[EMAIL PROTECTED]> [2007-10-09 01:55]: > What's wrong about this? > > eval "use My::Big::Namespace::$_;" > for qw( This That Munger::Fast Munger::Precise ); > die $@ if $@; That a) you check $@ to see if `eval` succeeded b) you do this only once after per

Re: RFC: relative.pm

2007-10-08 Thread A. Pagaltzis
* Eric Wilhelm <[EMAIL PROTECTED]> [2007-10-09 01:40]: > The brackets are clunky though, particularly with the qw() > inside them. > > use relative Third => -import => qw(with some args); You mean `-import =>` is less clunky than `[]`, and sometimes having to write several `use relative` lines is

Re: RFC: relative.pm

2007-10-08 Thread Philippe Bruhat (BooK)
On Sat, Oct 06, 2007 at 11:25:25AM +0100, Andy Armstrong wrote: >> >>> But I like neither the name nor the interface. How about this: >>> >>> package BigApp::Report; >>> use subclass qw(..::Utils Create Publish); >>> # loads BigApp::Utils, BigApp::Report::Create, >>> BigApp::Report::Pu

Re: RFC: relative.pm

2007-10-08 Thread Eric Wilhelm
# from Sébastien Aperghis-Tramoni # on Monday 08 October 2007 15:27: >Since the beginning, I had though that if I wanted to pass arguments   >to the modules, I'd write it like this: > >     use relative qw(First Second), Third => [qw(with some args)] > >because I usually load modules without passi

Re: RFC: relative.pm

2007-10-08 Thread Sébastien Aperghis-Tramoni
Johan Vromans wrote: Sébastien Aperghis-Tramoni <[EMAIL PROTECTED]> writes: use relative to_self => qw(Create Publish); # loads BigApp::Report::Create, BigApp::Report::Publish It is probably too late now, but despite the fact that being able to load multiple modules in one

Re: RFC: relative.pm

2007-10-08 Thread Jonathan Rockway
Pearce, Martyn wrote: > It is? How so? > Don't top-post. It ruins the flow for people trying to reply to you. To answer your question, see http://use.perl.org/~Aristotle/journal/33995 . FWIW, I (and thousands upon thousands of others) have used FindBin for years without problems. However,

RE: RFC: relative.pm

2007-10-08 Thread Pearce, Martyn
It is? How so? >-Original Message- >From: A. Pagaltzis [mailto:[EMAIL PROTECTED] >Sent: Monday, October 08, 2007 6:01 PM >To: module-authors@perl.org >Subject: Re: RFC: relative.pm > >* Sébastien Aperghis-Tramoni <[EMAIL PROTECTED]> [2007-10-08 18:15]: >

Re: RFC: relative.pm

2007-10-08 Thread A. Pagaltzis
* Sébastien Aperghis-Tramoni <[EMAIL PROTECTED]> [2007-10-08 18:15]: > AIUI, lib::relative already exists: it's called FindBin (and > the derivates). FindBin is broken. Regards, -- Aristotle Pagaltzis //

Re: RFC: relative.pm

2007-10-08 Thread Sébastien Aperghis-Tramoni
A. Pagaltzis wrote: > * Bill Ward <[EMAIL PROTECTED]> [2007-10-07 04:55]: > > Would "lib::relative" be too weird? > > There is already a `lib` pragma; `lib::relative` to me sounds > like "does something like `lib`, only relatively," which more > naturally suggests something to do with relative pat

Re: RFC: relative.pm

2007-10-08 Thread Sébastien Aperghis-Tramoni
A. Pagaltzis wrote: > * Chris Dolan <[EMAIL PROTECTED]> [2007-10-07 19:05]: > > The only thing it couldn't support is a single pkg called ::to. > > It can; I posted the workaround elsewhere. > > use relative to => __PACKAGE__, 'to'; > > Consider how often `to`/`-to` is going to be used, though

Re: RFC: relative.pm

2007-10-08 Thread David Cantrell
On Mon, Oct 08, 2007 at 01:51:21PM +0200, A. Pagaltzis wrote: > There is already a `lib` pragma; `lib::relative` to me sounds > like ???does something like `lib`, only relatively,??? which more > naturally suggests something to do with relative paths and > [EMAIL PROTECTED] > > I proposed pkg::re

Re: RFC: relative.pm

2007-10-08 Thread A. Pagaltzis
* Bill Ward <[EMAIL PROTECTED]> [2007-10-07 04:55]: > Would "lib::relative" be too weird? There is already a `lib` pragma; `lib::relative` to me sounds like “does something like `lib`, only relatively,” which more naturally suggests something to do with relative paths and [EMAIL PROTECTED] I prop

Re: RFC: relative.pm

2007-10-08 Thread A. Pagaltzis
* Chris Dolan <[EMAIL PROTECTED]> [2007-10-07 19:05]: > The only thing it couldn't support is a single pkg called ::to. It can; I posted the workaround elsewhere. use relative to => __PACKAGE__, 'to'; Consider how often `to`/`-to` is going to be used, though, and how often `to.pm` is going t

Re: RFC: relative.pm

2007-10-08 Thread Johan Vromans
Sébastien Aperghis-Tramoni <[EMAIL PROTECTED]> writes: > use relative to_self => qw(Create Publish); > # loads BigApp::Report::Create, BigApp::Report::Publish It is probably too late now, but despite the fact that being able to load multiple modules in one call is nice, I think

Re: RFC: relative.pm

2007-10-07 Thread Andy Armstrong
On 7 Oct 2007, at 21:48, Jim Schneider wrote: use relative to => "self", qw(foo bar roo); Anything else would be used the way it is currently defined. I like "relative to => 'self'", because it seems a bit more regular, and somewhat self documenting. I think that's the default. You onl

Re: RFC: relative.pm

2007-10-07 Thread Jim Schneider
A. Pagaltzis wrote: even with the current interface, it’s possible to load a to.pm if you do it this way: use relative to => __PACKAGE __, qw(to from before after boo); But that’s a) noisy b) less than self-suggesting. My I suggest this: use relative to => "self", qw(foo bar roo); Any

Re: RFC: relative.pm

2007-10-07 Thread Chris Dolan
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

Re: RFC: relative.pm

2007-10-06 Thread Bill Ward
On 10/6/07, David Cantrell <[EMAIL PROTECTED]> wrote: > Sébastien Aperghis-Tramoni wrote: > > Also agreeing for the API change. I know I was pondering about using > > ".." but can't remember why I didn't. > > '..' is only meaningful in the Unix/Win32 world. VMS, RISC OS and > others call it someth

Re: RFC: relative.pm

2007-10-06 Thread Bill Ward
On 10/6/07, Andy Armstrong <[EMAIL PROTECTED]> wrote: > On 6 Oct 2007, at 11:46, Sébastien Aperghis-Tramoni wrote: > >> Would it also do > >> > >> use relative [to => 'My::Big::Namespace'] => qw( This That > >> Munger::Fast Munger::Precise ); > > > > It can easily do that. The problem is more the n

Re: RFC: relative.pm

2007-10-06 Thread Sébastien Aperghis-Tramoni
A. Pagaltzis wrote: * Sébastien Aperghis-Tramoni <[EMAIL PROTECTED]> [2007-10-06 20:30]: As a side note, using find(1) on a mini-CPAN and Google CodeSearch, I only found 3 modules named "tp.pm": Don’t forget the darkPAN though. On a side note, if some people here know Perl modules outside C

Re: RFC: relative.pm

2007-10-06 Thread Sébastien Aperghis-Tramoni
David Cantrell wrote: Also agreeing for the API change. I know I was pondering about using ".." but can't remember why I didn't. '..' is only meaningful in the Unix/Win32 world. VMS, RISC OS and others call it something else. On the other hand, I think it's safe to assume that anyone usin

Re: RFC: relative.pm

2007-10-06 Thread Sébastien Aperghis-Tramoni
Ken Williams wrote: If there were a return value from import(), they could do something like this instead: package BigApp::Report; use relative; my $Pub = import relative to_self => qw(Create Publish); my $p = $Pub->new; Except that, 1), the API has changed

Re: RFC: relative.pm

2007-10-06 Thread Eric Wilhelm
# from A. Pagaltzis # on Saturday 06 October 2007 13:44: >Then again, I’d called mine lib::relative. Maybe this one should >be pkg::relative? That sounds good. --Eric -- We who cut mere stones must always be envisioning cathedrals. --Quarry worker's creed ---

Re: RFC: relative.pm

2007-10-06 Thread A. Pagaltzis
* Sébastien Aperghis-Tramoni <[EMAIL PROTECTED]> [2007-10-06 20:30]: > As a side note, using find(1) on a mini-CPAN and Google > CodeSearch, I only found 3 modules named "tp.pm": Don’t forget the darkPAN though. > An acceptable compromise it to write it as C< -to => Root > That’s what I’d sugges

Re: RFC: relative.pm

2007-10-06 Thread A. Pagaltzis
* Andy Armstrong <[EMAIL PROTECTED]> [2007-10-06 14:00]: > I always hesitate to suggest Aristotle is mistaken - it's not a common > occurrence Heh, thanks, but I am wrong plenty. :-) > but I really think 'subclass' is wrong. Yeah, I see the point, and I agree. But I really think `relative` is

Re: RFC: relative.pm

2007-10-06 Thread David Cantrell
Sébastien Aperghis-Tramoni wrote: > Hello Aristotle, >> But I like neither the name nor the interface. How about this: >> >> package BigApp::Report; >> use subclass qw(..::Utils Create Publish); >> # loads BigApp::Utils, BigApp::Report::Create, >> BigApp::Report::Publish > > "subclass"

Re: RFC: relative.pm

2007-10-06 Thread Ken Williams
On Oct 5, 2007, at 9:04 PM, Sébastien Aperghis-Tramoni wrote: The interest of such a module would be to ease writing modules using a big set of sibling modules (in the same hierarchy), and would also simplify refactoring and renaming. As of now the user still has to write the whole package

Re: RFC: relative.pm

2007-10-06 Thread Sébastien Aperghis-Tramoni
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 ca

Re: RFC: relative.pm

2007-10-06 Thread Paul Hoffman
On Sat, Oct 06, 2007 at 04:53:00PM +0200, S?bastien Aperghis-Tramoni wrote: > Andy Armstrong wrote: > > >>>Would it also do > >>> > >>>use relative [to => 'My::Big::Namespace'] => qw( This That > >>>Munger::Fast Munger::Precise ); > >> > >>It can easily do that. The problem is more the name. In

Re: RFC: relative.pm

2007-10-06 Thread Andy Armstrong
On 6 Oct 2007, at 15:53, Sébastien Aperghis-Tramoni wrote: Heh, thanks. I'll announce here when the module is available. Cool :) -- Andy Armstrong, Hexten

Re: RFC: relative.pm

2007-10-06 Thread David Golden
On 10/6/07, Andy Armstrong <[EMAIL PROTECTED]> wrote: > I always hesitate to suggest Aristotle is mistaken - it's not a > common occurrence - but I really think 'subclass' is wrong. As you > said this is an extension to the semantics of use that has (I > presume) nothing to do with any inheritance

Re: RFC: relative.pm

2007-10-06 Thread Sébastien Aperghis-Tramoni
Andy Armstrong wrote: Would it also do use relative [to => 'My::Big::Namespace'] => qw( This That Munger::Fast Munger::Precise ); It can easily do that. The problem is more the name. In this case, "use relative to ..." works well. But in y original example, "use subclass" works better.

Re: RFC: relative.pm

2007-10-06 Thread Andy Armstrong
On 6 Oct 2007, at 11:46, Sébastien Aperghis-Tramoni wrote: Would it also do use relative [to => 'My::Big::Namespace'] => qw( This That Munger::Fast Munger::Precise ); It can easily do that. The problem is more the name. In this case, "use relative to ..." works well. But in y original exam

Re: RFC: relative.pm

2007-10-06 Thread Sébastien Aperghis-Tramoni
Andy Armstrong wrote: But I like neither the name nor the interface. How about this: package BigApp::Report; use subclass qw(..::Utils Create Publish); # loads BigApp::Utils, BigApp::Report::Create, BigApp::Report::Publish "subclass" would imply more OO semantic than I'd like, a

Re: RFC: relative.pm

2007-10-06 Thread Andy Armstrong
On 6 Oct 2007, at 11:17, Sébastien Aperghis-Tramoni wrote: I like the idea. Catalyst privately invents something like that, so obviously there are other people who feel the same need. Yes, POE also provide a similar mechanism, that's why I was thinking to provide a generic module to do that.

Re: RFC: relative.pm

2007-10-06 Thread Sébastien Aperghis-Tramoni
Hello Aristotle, A. Pagaltzis wrote: Hi Sébastien, * Sébastien Aperghis-Tramoni <[EMAIL PROTECTED]> [2007-10-06 03:05]: package BigApp::Report; use relative to_parent => qw(Utils); # loads BigApp::Utils use relative to_self => qw(Create Publish); # lo

Re: RFC: relative.pm

2007-10-05 Thread A. Pagaltzis
Hi Sébastien, * Sébastien Aperghis-Tramoni <[EMAIL PROTECTED]> [2007-10-06 03:05]: > package BigApp::Report; > use relative to_parent => qw(Utils); > # loads BigApp::Utils > > use relative to_self => qw(Create Publish); > # loads BigApp::Report::Create, BigA

RFC: relative.pm

2007-10-05 Thread Sébastien Aperghis-Tramoni
Hello, Following a suggestion by a coworker, I wrote the following module: NAME relative - Load modules with relative names DESCRIPTION This module allows you to load modules using only parts of their name, relatively to the caller module. SYNOPSIS package BigApp::Repo