Re: S/SA/SAPER/relative-0.02.tar.gz (feature request)

2007-10-09 Thread Sébastien Aperghis-Tramoni
Eric Wilhelm wrote: # from Sébastien Aperghis-Tramoni # on Monday 08 October 2007 16:02: use relative; my $Customer = import relative qw(Report Customer); This changes the require() on Foo::Report and Foo::Customer to run- time though, right? Right, but I'd say that for

Re: S/SA/SAPER/relative-0.02.tar.gz (feature request)

2007-10-09 Thread Ovid
--- Sébastien Aperghis-Tramoni [EMAIL PROTECTED] wrote: Hmm.. As is, relative.pm already allows you to do that (thanks to Ken Williams' suggestion): package My::Enterprise::Framework; use relative; my $Customer = import relative qw(Report Customer); my $customer =

Re: S/SA/SAPER/relative-0.02.tar.gz (feature request)

2007-10-09 Thread Ovid
--- A. Pagaltzis [EMAIL PROTECTED] wrote: * Eric Wilhelm [EMAIL PROTECTED] [2007-10-09 01:55]: This changes the require() on Foo::Report and Foo::Customer to run-time though, right? use Devel::BeginLift qw( require ); Cute trick, but I wondered if that would globally break require.

Re: S/SA/SAPER/relative-0.02.tar.gz (feature request)

2007-10-09 Thread Jonathan Rockway
Ovid wrote: I do get tired of writing code like that (it happens a lot in test suites when I have use_ok $CLASS in a BEGIN block). OT, but 'ok.pm' is quite nice: use Test::More tests = 1; use ok 'My::Module'; # test runs at compile time Regards, Jonathan Rockway signature.asc

Re: S/SA/SAPER/relative-0.02.tar.gz (feature request)

2007-10-09 Thread Eric Wilhelm
# from A. Pagaltzis # on Monday 08 October 2007 22:50: * Eric Wilhelm [EMAIL PROTECTED] [2007-10-09 01:55]: This changes the require() on Foo::Report and Foo::Customer to run-time though, right?     use Devel::BeginLift qw( require ); The import() method is calling require at run-time.

(OT) Re: S/SA/SAPER/relative-0.02.tar.gz (feature request)

2007-10-09 Thread Ovid
--- Jonathan Rockway [EMAIL PROTECTED] wrote: OT, but 'ok.pm' is quite nice: use Test::More tests = 1; use ok 'My::Module'; # test runs at compile time Oh, I really like that, but it still causes an issue for me. You see, a lot of what I do is stuff like this: my $CLASS; BEGIN {

Re: S/SA/SAPER/relative-0.02.tar.gz (feature request)

2007-10-09 Thread Eric Wilhelm
# from Sébastien Aperghis-Tramoni # on Tuesday 09 October 2007 00:07: This changes the require() on Foo::Report and Foo::Customer to run- time though, right? Right, but I'd say that for writing object-oriented code, there isn't   such a need to do things at compile time, is it? Probably not,

Re: S/SA/SAPER/relative-0.02.tar.gz (feature request)

2007-10-09 Thread A. Pagaltzis
* Eric Wilhelm [EMAIL PROTECTED] [2007-10-09 09:50]: The import() method is calling require at run-time. That's going to take some heavy lifting ;-) Err, I meant `qw( import )`. Regards, -- Aristotle Pagaltzis // http://plasmasturm.org/

Re: S/SA/SAPER/relative-0.02.tar.gz (feature request)

2007-10-09 Thread A. Pagaltzis
* Ovid [EMAIL PROTECTED] [2007-10-09 09:40]: --- A. Pagaltzis [EMAIL PROTECTED] wrote: * Eric Wilhelm [EMAIL PROTECTED] [2007-10-09 01:55]: This changes the require() on Foo::Report and Foo::Customer to run-time though, right? use Devel::BeginLift qw( require ); Cute trick,

Re: (OT) Re: S/SA/SAPER/relative-0.02.tar.gz (feature request)

2007-10-09 Thread Smylers
Ovid writes: With the lovely ok.pm module, I still have the following clunky construct: my $CLASS; BEGIN { $CLASS = 'Customer'; } use ok $CLASS or die; can_ok $CLASS, 'new'; ok my $cust = $CLASS-new, '... and we can call it'; isa_ok $cust, $CLASS, '... and the

Re: (OT) Re: S/SA/SAPER/relative-0.02.tar.gz (feature request)

2007-10-09 Thread A. Pagaltzis
* Smylers [EMAIL PROTECTED] [2007-10-09 10:25]: Well don't have them then -- put the assignment in the use statement, which is run at BEGIN time anyway: use Test::More tests = 1; my $CLASS; use ok $CLASS = 'DateTime'; Sneaky! I like. -- *AUTOLOAD=*_;sub _{s/(.*)::(.*)/print$2,(,$\/,

Re: S/SA/SAPER/relative-0.02.tar.gz (feature request)

2007-10-09 Thread Sébastien Aperghis-Tramoni
Ovid wrote: --- Sébastien Aperghis-Tramoni [EMAIL PROTECTED] wrote: Eric Wilhelm wrote: use relative; my $Customer = import relative qw(Report Customer); This changes the require() on Foo::Report and Foo::Customer to run- time though, right? Right, but I'd say

Re: S/SA/SAPER/relative-0.02.tar.gz (feature request)

2007-10-08 Thread Ovid
--- Sébastien Aperghis-Tramoni [EMAIL PROTECTED] wrote: 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 :-) I like the idea of this module. Lots of people like the idea of 'aliased'.

Re: S/SA/SAPER/relative-0.02.tar.gz (feature request)

2007-10-08 Thread Adrian Howard
On 8 Oct 2007, at 11:28, Ovid wrote: [snip] I like the idea of this module. Lots of people like the idea of 'aliased'. Would it be worth combining the two? use My::Enterprise::Framework; use relative -aliased = qw(Customer Report); # instead of: # my $customer =

Re: S/SA/SAPER/relative-0.02.tar.gz (feature request)

2007-10-08 Thread Sébastien Aperghis-Tramoni
Ovid wrote: I like the idea of this module. Lots of people like the idea of 'aliased'. Would it be worth combining the two? use My::Enterprise::Framework; use relative -aliased = qw(Customer Report); # instead of: # my $customer = My::Enterprise::Framework::Customer-new($id); #

Re: S/SA/SAPER/relative-0.02.tar.gz (feature request)

2007-10-08 Thread Eric Wilhelm
# from Sébastien Aperghis-Tramoni # on Monday 08 October 2007 16:02:      use relative;      my $Customer = import relative qw(Report Customer); This changes the require() on Foo::Report and Foo::Customer to run-time though, right? If only we had userland pragmas, you could just create

Re: S/SA/SAPER/relative-0.02.tar.gz (feature request)

2007-10-08 Thread A. Pagaltzis
* Eric Wilhelm [EMAIL PROTECTED] [2007-10-09 01:55]: This changes the require() on Foo::Report and Foo::Customer to run-time though, right? use Devel::BeginLift qw( require ); :- Regards, -- Aristotle Pagaltzis // http://plasmasturm.org/