Re: Exporter::Safe?

2008-07-21 Thread Ovid
--- On Sat, 19/7/08, Bill Ward [EMAIL PROTECTED] wrote: I can't think of any reason you would want to use an imported subroutine as an object method. Class::Trait Moose::Role mixin Cheers, Ovid -- Buy the book - http://www.oreilly.com/catalog/perlhks/ Tech blog-

Re: Exporter::Safe?

2008-07-21 Thread Bill Ward
On Mon, Jul 21, 2008 at 12:12 AM, Ovid [EMAIL PROTECTED] wrote: --- On Sat, 19/7/08, Bill Ward [EMAIL PROTECTED] wrote: I can't think of any reason you would want to use an imported subroutine as an object method. Class::Trait Moose::Role mixin I've never used any of those... but in

Re: Exporter::Safe?

2008-07-18 Thread Bill Ward
Sorry for replying to an old thread... but I was catching up on old email. It occurs to me that if we had the behavior that OO method calling would reject any imported modules, wouldn't that solve the problem? I can't think of any reason you would want to use an imported subroutine as an object

Re: Exporter::Safe?

2008-07-18 Thread Jonathan Rockway
* On Fri, Jul 18 2008, Bill Ward wrote: Sorry for replying to an old thread... but I was catching up on old email. It occurs to me that if we had the behavior that OO method calling would reject any imported modules, wouldn't that solve the problem? How do you tell what an imported

Re: Exporter::Safe?

2008-07-18 Thread Bill Ward
On Fri, Jul 18, 2008 at 8:04 PM, Jonathan Rockway [EMAIL PROTECTED] wrote: * On Fri, Jul 18 2008, Bill Ward wrote: It occurs to me that if we had the behavior that OO method calling would reject any imported modules, wouldn't that solve the problem? How do you tell what an imported subroutine

Re: Exporter::Safe?

2008-06-24 Thread David Cantrell
On Fri, Jun 20, 2008 at 01:45:41PM +0100, Ovid wrote: Buried deep within some code, someone used a module (Test::Most 0.03) which exports a 'set' function. They weren't actually using that module. It was just leftover cruft. Unfortunately, the parent class of that module inherited from

Re: Exporter::Safe?

2008-06-21 Thread Ovid
--- Hans Dieter Pearcey [EMAIL PROTECTED] wrote: never does anything to the importing package use Foo::Bar as = Bar; plops a constant function Bar into your package. The constant is an object on which you can do Bar-some_function(@args) and it is the equivalent of calling

Re: Exporter::Safe?

2008-06-21 Thread Fergal Daly
2008/6/20 Hans Dieter Pearcey [EMAIL PROTECTED]: On Fri, Jun 20, 2008 at 04:19:41PM +0100, Fergal Daly wrote: To be a little more constructive. Here's something that is implementable and I think reasonable. use Foo::Bar; never does anything to the importing package use Foo::Bar as = Bar;

Exporter::Safe?

2008-06-20 Thread Ovid
Buried deep within some code, someone used a module (Test::Most 0.03) which exports a 'set' function. They weren't actually using that module. It was just leftover cruft. Unfortunately, the parent class of that module inherited from Class::Accessor. Test::Most exports 'set' and Class::Accessor

Re: Exporter::Safe?

2008-06-20 Thread Ovid
--- Ovid [EMAIL PROTECTED] wrote: I'm trying to think of the best way to deal with this. My first thought is to create a drop in replacement for Exporter which will not export a function if caller-can($function) *unless* the person explicitly lists it in the import list with a unary plus:

Re: Exporter::Safe?

2008-06-20 Thread Fergal Daly
* the person explicitly lists it in the import list with a unary plus: # 2008 use Foo; # exports nothing use Bar; # exports set with Exporter::Safe set() # Bar # 2009 after upgrading some modules use Foo; # new version in 2009 exports set use Bar; # exports set with Exporter::Safe set

Re: Exporter::Safe?

2008-06-20 Thread Fergal Daly
explicitly lists it in the import list with a unary plus: # 2008 use Foo; # exports nothing use Bar; # exports set with Exporter::Safe set() # Bar # 2009 after upgrading some modules use Foo; # new version in 2009 exports set use Bar; # exports set with Exporter::Safe set() # now Foo

Re: Exporter::Safe?

2008-06-20 Thread Fergal Daly
it in the import list with a unary plus: # 2008 use Foo; # exports nothing use Bar; # exports set with Exporter::Safe set() # Bar # 2009 after upgrading some modules use Foo; # new version in 2009 exports set use Bar; # exports set with Exporter::Safe set() # now Foo and triggers rm -rf / :) Of course

Re: Exporter::Safe?

2008-06-20 Thread Eric Wilhelm
# from Ovid # on Friday 20 June 2008 05:45: Test::Most exports 'set' and Class::Accessor calls a 'set' method. Oops. I'm trying to think of the best way to deal with this.  My first thought is to create a drop in replacement for Exporter which will not export a function if caller-can($function)

Re: Exporter::Safe?

2008-06-20 Thread Hans Dieter Pearcey
On Fri, Jun 20, 2008 at 04:19:41PM +0100, Fergal Daly wrote: To be a little more constructive. Here's something that is implementable and I think reasonable. use Foo::Bar; never does anything to the importing package use Foo::Bar as = Bar; plops a constant function Bar into your