Will print HI; not work...you would think you wouldn't have to qualify it if you import it into your namespace? ----- Original Message ----- From: "david" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, November 22, 2002 3:32 PM Subject: Re: exporting Constants
> 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] > > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]