using constants in a module

Discussion in 'Perl Misc' started by brad, Feb 10, 2004.

  1. brad

    brad Guest

    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
    brad, Feb 10, 2004
    #1
    1. Advertising

  2. brad

    Anno Siegel Guest

    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
    Anno Siegel, Feb 10, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dave Harris

    Type constants in type module

    Dave Harris, Nov 2, 2003, in forum: Python
    Replies:
    1
    Views:
    272
    Terry Reedy
    Nov 2, 2003
  2. Torsten Mohr
    Replies:
    1
    Views:
    291
    Fredrik Lundh
    Jan 17, 2005
  3. Nathan Harmston

    Importing module of data dicts and constants

    Nathan Harmston, Nov 25, 2006, in forum: Python
    Replies:
    1
    Views:
    230
    Fuzzyman
    Nov 25, 2006
  4. Jos Backus
    Replies:
    6
    Views:
    201
    Jos Backus
    Dec 2, 2004
  5. Lloyd Zusman
    Replies:
    5
    Views:
    150
    Joel VanderWerf
    Feb 20, 2005
Loading...

Share This Page