Re: exporting Constants

2002-11-22 Thread Tanton Gibbs
lp in clarifying the issue. Tanton - Original Message - From: "david" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, November 22, 2002 5:12 PM Subject: Re: exporting Constants > Tanton Gibbs wrote: > > > Sure it is, because you imported it from T

Re: exporting Constants

2002-11-22 Thread david
Tanton Gibbs wrote: > Sure it is, because you imported it from Test...I tried the following No, you can call (or use the constant) it without full qualifying it doens't mean the function or the constant is in your namespace. as you said below, Perl has way of finding it from the Exporter interf

Re: exporting Constants

2002-11-22 Thread Tanton Gibbs
oops, left off a ; and a 1; corrections below. - Original Message - From: "Tanton Gibbs" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, November 22, 2002 4:44 PM Subject: Re: exporting Constants > Sure it is, because you imported it from Tes

Re: exporting Constants

2002-11-22 Thread Tanton Gibbs
ROTECTED]> Sent: Friday, November 22, 2002 4:13 PM Subject: Re: exporting Constants > Tanton Gibbs wrote: > > > Huh? I thought constants were implemented as functions? In other words, > > HI and HI() should both refer to the same entity. > > true. but not in the

Re: exporting Constants

2002-11-22 Thread david
Tanton Gibbs wrote: > Huh? I thought constants were implemented as functions? In other words, > HI and HI() should both refer to the same entity. true. but not in the your current namespace. david -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: exporting Constants

2002-11-22 Thread Tanton Gibbs
Huh? I thought constants were implemented as functions? In other words, HI and HI() should both refer to the same entity. - Original Message - From: "david" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, November 22, 2002 4:06 PM Subject: Re: exportin

Re: exporting Constants

2002-11-22 Thread david
Tanton Gibbs wrote: > Ah, then what about > print HI, "\n"; > no. sorry! :-( in that case, Perl probably thinks that you want to call the function HI and than print whatever that function return to STDOUT. no such HI function so Perl will panic! :-) david -- To unsubscribe, e-mail: [EMAIL

Re: exporting Constants

2002-11-22 Thread Tanton Gibbs
Ah, then what about print HI, "\n"; the comma should disambiguate from a filehandle, right? - Original Message - From: "david" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, November 22, 2002 4:02 PM Subject: Re: exporting Constants > Tant

Re: exporting Constants

2002-11-22 Thread david
Tanton Gibbs wrote: > Will print HI; not work...you would think you wouldn't have to qualify it > if you import it into your namespace? the statement: print HI; won't work. it's: print Test::HI,"\n"; that i have in the code. Otherwise, Perl thinks that you want to print $_ to the HI file ha

Re: exporting Constants

2002-11-22 Thread Tanton Gibbs
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 Cons

Re: exporting Constants

2002-11-22 Thread david
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