Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > using constants in a module

Reply
Thread Tools

using constants in a module

 
 
brad
Guest
Posts: n/a
 
      02-10-2004
I am creating various modules and in these modules, I would like to be
able to use constant XXX => X;
just like it was declared in the .pl file that uses that module. How
is this possible.

declaring the constants in the module and using that module does not
work.
thanks
 
Reply With Quote
 
 
 
 
Anno Siegel
Guest
Posts: n/a
 
      02-10-2004
brad <> wrote in comp.lang.perl.misc:
> I am creating various modules and in these modules, I would like to be
> able to use constant XXX => X;
> just like it was declared in the .pl file that uses that module. How
> is this possible.
>
> declaring the constants in the module and using that module does not
> work.
> thanks


You probably want to export them. See "perldoc Exporter".

Anno
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Importing module of data dicts and constants Nathan Harmston Python 1 11-25-2006 02:29 PM
Why don't I see these module constants? Lloyd Zusman Ruby 5 02-20-2005 08:36 PM
supplying constants in an extension module Torsten Mohr Python 1 01-17-2005 09:23 PM
Accessing class constants from within a module? Jos Backus Ruby 6 12-02-2004 04:51 PM
Type constants in type module Dave Harris Python 1 11-02-2003 10:51 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57