Re: relative.pm

2007-10-07 Thread Peter Pentchev
On Sun, Oct 07, 2007 at 12:40:06AM +0200, S?bastien Aperghis-Tramoni wrote:
 Dr.Ruud wrote:
 
 S?bastien Aperghis-Tramoni schreef:
 
  package BigApp::Report;
 
 These would also be nice:
 
 package BigApp::__FROMFILE__;
 
 package BigApp::__FROMFILE__($RCSfile);
 
 Not sure how this is supposed to work, but I think this is beyond the aim 
 of relative.pm

A source filter, perhaps?  But yes, IMHO it is beside the point too.

G'luck,
Peter

-- 
Peter Pentchev  [EMAIL PROTECTED][EMAIL PROTECTED][EMAIL PROTECTED]
PGP key:http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
This sentence no verb.


pgpvFtDdyX1TY.pgp
Description: PGP signature


Re: relative.pm

2007-10-07 Thread Andy Armstrong

On 7 Oct 2007, at 15:33, Peter Pentchev wrote:

A source filter, perhaps?


Run away! :)

--
Andy Armstrong, Hexten





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 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

Fwd: CPAN Upload: S/SA/SAPER/relative-0.02.tar.gz

2007-10-07 Thread Sébastien Aperghis-Tramoni

Hello,

The version 0.02 of relative.pm is now available on the CPAN.
Thanks to everybody who suggested improvements.
(And it still works on Perl 5.004 :-)


Forwarded message:


From: PAUSE [EMAIL PROTECTED]
Date: 7 octobre 2007 19:58:44 HAEC
To: Sebastien Aperghis-Tramoni [EMAIL PROTECTED]
Subject: CPAN Upload: S/SA/SAPER/relative-0.02.tar.gz

The uploaded file

relative-0.02.tar.gz

has entered CPAN as

  file: $CPAN/authors/id/S/SA/SAPER/relative-0.02.tar.gz
  size: 4459 bytes
   md5: 9deb938f018c86e8ab4b48b4225b6978

No action is required on your part
Request entered by: SAPER (Sébastien Aperghis-Tramoni)
Request entered on: Sun, 07 Oct 2007 17:57:27 GMT
Request completed:  Sun, 07 Oct 2007 17:58:44 GMT


--
Sébastien Aperghis-Tramoni

Close the world, txEn eht nepO.



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);

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.


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 only use 'to' (or -to now :) to  
resolve names relative to some other namespace.


This module allows you to load modules using only parts of their  
name, relatively to the current module or to a given module. Module  
names are by default searched below the current module, but can be  
searched upper in the hierarchy using the ..:: syntax.


From:
  http://search.cpan.org/~saper/relative-0.02/lib/relative.pm

--
Andy Armstrong, Hexten