Tom Allison wrote:

> How do I export a Constant from a module?
> 
> Test.pm:
> 
> package Test;
> 
> @EXPORT_OK = qw(__what__);
> use constant FOO => 123;
> 

name the following Test.pm:

#!/usr/bin/perl -w
use strict;

package Test;

use Exporter;
our @EXPORT_OK = qw(HI);

use constant HI => 'Hi I am a constant in Test.pm';

1;

__END__

name the following test.pl:

#!/usr/bin/perl -w
use strict;

use Test qw(HI);

print TEST::HI,"\n";

__END__

prints:

Hi I am a constant in Test.pm

that's what you want right?

david

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to