Re: Global Constants in Perl ?

2002-02-20 Thread Sir Douglas Cook

Hi Doug here.

I would like to include this information (see below) at the top of all of
my CGI scripts. In such a way that if I upload all of my CGI scripts
to a different server all I have to do is change one file
and all of my scripts should work on the new server.



#$SMTP_SERVER=localhost;
$SEND_MAIL=/usr/lib/sendmail -t;

$BASEDIR=/usr/www/my-server/grayspace;
$BASEURL=http://my-server/grayspace;;
$SITEURL=http://my-server/cgi-bin/grayspace/rod/rod.cgi;;
$SITENAME=my-server;
$PARENTURL=http://www.my-server;;
$EXT=.html;
$PROGNAME=/cgi-bin/card.cgi;
$PROGAREA=/cgi-bin/grayspace/rod;
$MAILLOG=ml1;
$SUBJECT =my-server subject line here!;
*

What is the best  to do this?

Many thanks in advance
[EMAIL PROTECTED]


Note: I use  #64;  instead of the  @  sign on my webpages
avoid spiders.


- Original Message -
From: John Edwards [EMAIL PROTECTED]
To: 'Stephen.Hurley' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, February 19, 2002 9:22 AM
Subject: RE: Global Constants in Perl ?


 Yep. Use the constant function

 http://perlhelp.web.cern.ch/PerlHelp/lib/constant.html

 -Original Message-
 From: Stephen.Hurley [mailto:[EMAIL PROTECTED]]
 Sent: 19 February 2002 17:31
 To: '[EMAIL PROTECTED]'
 Subject: Global Constants in Perl ?


 Hi,

 I was wondering if there was a way of defining global constants in Perl ?
I
 use strict to keep all my variables tidy. However, there are a number of
 #define-like vars that I would like to keep all together at the top of
my
 files, so that they can be reconfigured by whoever maintains my code
 (filenames and such). Since these won't need to be changed by the
script...I
 wanna make 'em constants. But I also don't want to have to keep passing
them
 around to subroutines (I want to them to be global). But I also would like
 to use strict (which tends not to like global variables). Is there any
 #define-like construct in Perl or am I asking for too much ? If so,
what's
 the next best thing ?

 Steve.



 /.
 Stephen Hurley,
 Room CS2-034,
 IDC, University Of Limerick.

 P. 087-6701459
 E. [EMAIL PROTECTED]
 A. Apt.10, Charlotte Q, Limerick City.

 I'm not a conspiracy theorist, but there are people here who are trying
to
 make me look like one...

 .../

 --
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 --Confidentiality--.
 This E-mail is confidential.  It should not be read, copied, disclosed or
 used by any person other than the intended recipient.  Unauthorised use,
 disclosure or copying by whatever medium is strictly prohibited and may be
 unlawful.  If you have received this E-mail in error please contact the
 sender immediately and delete the E-mail from your system.



 --
 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]




Global Constants in Perl ?

2002-02-19 Thread Stephen.Hurley

Hi,

I was wondering if there was a way of defining global constants in Perl ? I
use strict to keep all my variables tidy. However, there are a number of
#define-like vars that I would like to keep all together at the top of my
files, so that they can be reconfigured by whoever maintains my code
(filenames and such). Since these won't need to be changed by the script...I
wanna make 'em constants. But I also don't want to have to keep passing them
around to subroutines (I want to them to be global). But I also would like
to use strict (which tends not to like global variables). Is there any
#define-like construct in Perl or am I asking for too much ? If so, what's
the next best thing ?

Steve.



/.
Stephen Hurley,
Room CS2-034,
IDC, University Of Limerick.

P. 087-6701459
E. [EMAIL PROTECTED]
A. Apt.10, Charlotte Q, Limerick City.

I'm not a conspiracy theorist, but there are people here who are trying to
make me look like one...

../

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Global Constants in Perl ?

2002-02-19 Thread John Edwards

Yep. Use the constant function

http://perlhelp.web.cern.ch/PerlHelp/lib/constant.html

-Original Message-
From: Stephen.Hurley [mailto:[EMAIL PROTECTED]]
Sent: 19 February 2002 17:31
To: '[EMAIL PROTECTED]'
Subject: Global Constants in Perl ?


Hi,

I was wondering if there was a way of defining global constants in Perl ? I
use strict to keep all my variables tidy. However, there are a number of
#define-like vars that I would like to keep all together at the top of my
files, so that they can be reconfigured by whoever maintains my code
(filenames and such). Since these won't need to be changed by the script...I
wanna make 'em constants. But I also don't want to have to keep passing them
around to subroutines (I want to them to be global). But I also would like
to use strict (which tends not to like global variables). Is there any
#define-like construct in Perl or am I asking for too much ? If so, what's
the next best thing ?

Steve.



/.
Stephen Hurley,
Room CS2-034,
IDC, University Of Limerick.

P. 087-6701459
E. [EMAIL PROTECTED]
A. Apt.10, Charlotte Q, Limerick City.

I'm not a conspiracy theorist, but there are people here who are trying to
make me look like one...

.../

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--Confidentiality--.
This E-mail is confidential.  It should not be read, copied, disclosed or
used by any person other than the intended recipient.  Unauthorised use,
disclosure or copying by whatever medium is strictly prohibited and may be
unlawful.  If you have received this E-mail in error please contact the
sender immediately and delete the E-mail from your system.



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]