in reply to Exporting symbols from another package
When I wanted to achieve something like that, this is what I did:
package Foo::One; use warnings; use strict; use base qw/Foo Exporter/; our @EXPORT_OK = qw/action1/; sub action1 { ... } package Foo::Two; use warnings; use strict; use base qw/Foo Exporter/; our @EXPORT_OK = qw/action2/; sub action2 { ... } package Foo; MHT::One->import (qw/action1/); MHT::Two->import (qw/action2/); our %EXPORT_TAGS = ( One => [qw/action1/], Two => [qw/action2/], ); Exporter::export_ok_tags keys %EXPORT_TAGS;
And later:
use Foo qw/:One :Two/;
Which is basically what BrowserUk suggests.
--
David Serrano
(Please treat my english text just like Perl code, i.e. feel free to notify me of any syntax, grammar, style and/or spelling error. Thank you!).
|
---|
In Section
Seekers of Perl Wisdom