Re: Is there nealy same module? ExportTo
- From: Jimi-Carlo Bukowski-Wills <jimicarlo@xxxxxxxxxxxxxxxx>
- Date: Tue, 14 Mar 2006 19:56:33 GMT
Exporter??
is it a joke?
ktat wrote:
Hi, All..
I have one module my calling ExportTo. It easily export function/method
to anywhere.
If you know a module like it, please tell me.
If there are no modules like this, I want to upload this to CPAN.
==============================================================================
NAME
ExportTo - export function/method to namespace
SYNOPSIS
package From;
sub function1{ ... }
sub function2{ ... }
sub function3{ ... }
use ExportTo (NameSpace1 => [qw/function1 function2/], NameSpace2
=> [qw/function3/]);
# Now, function1 and function2 are exported to 'NameSpace1'
namespace.
# function3 is exported to 'NameSpace2' namespace.
# If 'NameSpace1'/'NameSpace2' namespace has same name
function/method,
# such a function/method is not exported and ExportTo croaks.
# but if you want to override, you can do it as following.
use ExportTo (NameSpace1 => qw/+function1 function2/);
# if adding + to function/method name,
# This override function/method which namespace already has with
exported funtion/method.
use ExportTo ('+NameSpace' => qw/function1 function2/);
# if you add + to namespace name, all functions are exported even
if namespace already has function/method.
==============================================================================
- Follow-Ups:
- Re: Is there nealy same module? ExportTo
- From: ktat
- Re: Is there nealy same module? ExportTo
- References:
- Is there nealy same module? ExportTo
- From: ktat
- Is there nealy same module? ExportTo
- Prev by Date: Re: Proposed module: Music::ChordNamer
- Next by Date: Re: Proposed module: Music::ChordNamer
- Previous by thread: Is there nealy same module? ExportTo
- Next by thread: Re: Is there nealy same module? ExportTo
- Index(es):
Relevant Pages
|
|