Right. I almost forgot that one can use regular flags passed from command line for this,
They are not constants but they serve my purpose.


Regards,
Sharan
On Jul 7, 2015 10:19 PM, Charles DeRykus <dery...@gmail.com> wrote:
On Tue, 7 Jul 2015 11:40:35 +0000
"Sharanbasappa Raghapur, ERS, HCLTech" <shar...@hcl.com> wrote:

> I am using constant mainly to enable printing of debugging messages
> (e.g. use constant DEBUGGING_L1 => 0;) Normally, the value is '0' and
> when I need to see debug messages, I make this 1 and run the script.
>
> Is there a way to allocate value to constants at run time so that I
> can avoid editing the script again and again? Also, is there a better
> way to handle debugging?

You don't get those conditional compilation speedup's
but you could pass an argument to the script to save
editing:


#!perl
my $DEBUG;
($DEBUG = shift) //= 0;  # no debug if no arg missing
...

if ($DEBUG) { ... }

--
Charles DeRykus

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




::DISCLAIMER::
----------------------------------------------------------------------------------------------------------------------------------------------------

The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only.
E-mail transmission is not guaranteed to be secure or error-free as information could be intercepted, corrupted,
lost, destroyed, arrive late or incomplete, or may contain viruses in transmission. The e mail and its contents
(with or without referred errors) shall therefore not attach any liability on the originator or HCL or its affiliates.
Views or opinions, if any, presented in this email are solely those of the author and may not necessarily reflect the
views or opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification,
distribution and / or publication of this message without the prior written consent of authorized representative of
HCL is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately.
Before opening any email and/or attachments, please check them for viruses and other defects.

----------------------------------------------------------------------------------------------------------------------------------------------------

-- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Reply via email to