Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Package exporter not working ?

Status
Not open for further replies.

1DMF

Programmer
Jan 18, 2005
8,795
0
0
GB
Hi,

Any idea why this export isn't working in this code?

Code:
package Utils;

# Invoke Exporter
use Exporter;

# Set Variables
our @ISA = qw(Exporter);

our %EXPORT_TAGS = ( 
    
    'SMTP' => [ qw(SMTP_DOMAIN) ],
    
    'RAG' => [ qw(RAG_RATING RAG_COLORS) ], 
    
    'INPUT' => [ qw(cleanInput buildUPD buildADD) ],   
    
);

our @EXPORT = qw( ISDate UKDate setSPArgs );

our @EXPORT_OK = ( @{ $EXPORT_TAGS{'SMTP'} }, @{ $EXPORT_TAGS{'RAG'} }, @{ $EXPORT_TAGS{'INPUT'} } );

sub import {
    push(@_, qw/ ISDate UKDate setSPArgs /); 
    goto &Exporter::import;
}

The default packages I want exporting work (ISDate UKDate setSPArgs ) but if I try to use the module with only a specific export...
Code:
use Utils qw(INPUT);

it errors saying 'INPUT is not exported'.

The override I've tried to put in to ensure some subs are always exported seems to have broken the ability to select what gets exported?

You help is appreciated

Thanks,
1DMF

"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"

Free Dance Music Downloads
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top