declaring constants

From: Troy Knight (troyboy_at_blueyonder.co.uk)
Date: 07/25/04


Date: Sun, 25 Jul 2004 05:42:39 GMT

This may seem like a dumb question but I've only just got back into perl
after a few years. I would be very grateful if someonme could answer this...

I'm trying to define constants which can be used across multiple source
files. This:

use constanr MY_CONSTANT => 5;

seems to only work if it's put in the main source file. How do I rectify
this so it can be used when it's defined in another source file?

Many thanks,

Troy Knight



Relevant Pages

  • Re: make
    ... handle more than one source file. ... nice convenient solution: MKMF. ... makes a Makefile automatically (You need the Perl interpreter for your ... MinGW/Msys/MsysDTK packages or in Cygwin ...
    (comp.lang.fortran)
  • Perl and Dos Batch File Create
    ... I am new to Perl and I am trying to use Perl to complete this task. ... I have a source file that list the parameter that needs to be inserted ... into a batch file, as shown below the parameter needs to be inserted ... Output File 2 (Filename 06712305CO.bat) ...
    (comp.lang.perl.misc)
  • Re: Sum the middle column for a given unique volser.
    ... scan your entire source file to find all the times the variable might ... before you meant to, 9 times out of 10, Perl will be able to warn you ... By initializing those variables before you have any reason ... `my %hash;` will do fine. ...
    (comp.lang.perl.misc)
  • Re: uninitialized value in concatenation ...
    ... why are you again testing $price when you just returned if you have no ... you should never have a source file with so much code in ... i bet your line numbering is at fault. ... perl may have a different view of what line numbers ...
    (comp.lang.perl.misc)
  • Re: Environment question
    ... BS> In my other languages, Kylix, Delphi, C, each class, module, object, ... is in its own source file so that you are only looking at the ... Since Perl apparently doesn't have an include ...
    (comp.lang.perl.misc)