How to import Foo::Bar::mysub when caller writes 'use Foo qw(mysub)'?

2011-01-16 Thread David Christensen
module-authors: Let's say I have a CPAN distribution called Foo: # Foo.pm package Foo; And suppose the distribution includes: package Foo::Bar; sub mysub { print hello, world!\n } I would like callers to be able to import mysub() with a traditional 'use'

Re: How to import Foo::Bar::mysub when caller writes 'use Foo qw(mysub)'?

2011-01-16 Thread Shmuel Fomberg
Hi David. How about importing mysub from Foo::Bar to Foo, and let Exporter to deal with the next step? package Foo; use Foo::Bar qw{mysub}; our @EXPORT = qw{ mysub }; should work. Shmuel. On 2011/01/16 22:03, David Christensen wrote: module-authors: Let's say I have a CPAN

Re: How to import Foo::Bar::mysub when caller writes 'use Foo qw(mysub)'?

2011-01-16 Thread Shawn H Corey
On 11-01-16 03:03 PM, David Christensen wrote: Bonus question: use Fooqw( :all ); What is the best way to accomplish the goal? Fill in @EXPORT and @EXPORT_OK as needed. # -- # Exports use base qw( Exporter ); our @EXPORT = qw( ); our

Re: How to import Foo::Bar::mysub when caller writes 'use Foo qw(mysub)'?

2011-01-16 Thread David Christensen
Shmuel Fomberg wrote: How about importing mysub from Foo::Bar to Foo, and let Exporter to deal with the next step? package Foo; use Foo::Bar qw{mysub}; our @EXPORT = qw{ mysub }; should work. I was wondering about that idea, but was doubtful. Let's try it: 2011-01-16 13:47:47