saurabh.hirani has asked for the wisdom of the Perl Monks concerning the following question:
I am writing a program which is going to create an object of a perl class and uses a bunch of constants. I don't want to export those constants because I can access them through my class object. I was going through the constant man page and saw that perl replaces constant values by their inline subroutine calls.
I am asking this because my program is going to be a sendmail milter (a program which is called for each stage of an SMTP session to decide whether the message is acceptable depending on sender, rcpt, etc). It is going to be bombed with SMTP transactions at a very high rate.
A sample snippet of code:
my $logobj = new Merce::Log; $logobj->log($logobj->PRIORITY, $logobj->MSGTMPL);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: The best way to use constants
by almut (Canon) on Apr 02, 2009 at 16:33 UTC | |
|
Re: The best way to use constants
by perrin (Chancellor) on Apr 02, 2009 at 16:44 UTC | |
|
Re: The best way to use constants
by pileofrogs (Priest) on Apr 02, 2009 at 16:46 UTC | |
|
Re: The best way to use constants
by JavaFan (Canon) on Apr 02, 2009 at 18:26 UTC | |
by almut (Canon) on Apr 02, 2009 at 19:29 UTC | |
by saurabh.hirani (Beadle) on Apr 03, 2009 at 06:13 UTC |