Re: Debugging and passing constant value at run time

2015-07-07 Thread Sharanbasappa Raghapur, ERS, HCLTech
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 wrote: On Tue, 7 Jul 2015 11:40:35 + "Sharanbasappa Raghapur, ERS, HCLTech" wr

Re: Regexp under PERL

2015-07-07 Thread Kent Fredric
On 8 July 2015 at 04:40, Nagy Tamas (TVI-GmbH) wrote: > m/\(\*[ ]+\"\@PATH\"[ ]+:=[ ]+'(\/)?([\*A-Za-z_ ]*(\/)?)+'[ ]\*\)?/)) This is not the exact code you 're using obviously, because the last 2 ")" marks are actually outside the regex. Removing those ))'s makes the regex compile just fine. S

Re: Debugging and passing constant value at run time

2015-07-07 Thread Charles DeRykus
On Tue, 7 Jul 2015 11:40:35 + "Sharanbasappa Raghapur, ERS, HCLTech" 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. > >

Regexp under PERL

2015-07-07 Thread Nagy Tamas (TVI-GmbH)
Hi, PERL shows this line ok, but for the next lines it tells: String found where operator expected at line... m/\(\*[ ]+\"\@PATH\"[ ]+:=[ ]+'(\/)?([\*A-Za-z_ ]*(\/)?)+'[ ]\*\)?/)) So it seems that it is not ok. I have the proper regexp that was tested at http://www.regexr.com/ # Tested versi

Re: Debugging and passing constant value at run time

2015-07-07 Thread Uri Guttman
On 07/07/2015 10:52 AM, Ron Bergin wrote: Which means that neither approach is perfect. I still prefer the variable over the constant. I have never done any benchmark tests to see if there is any significant performance difference. Have you? if you have a lot of debugging code, it can make

Re: Debugging and passing constant value at run time

2015-07-07 Thread Ron Bergin
Which means that neither approach is perfect. I still prefer the variable over the constant. I have never done any benchmark tests to see if there is any significant performance difference. Have you? Ron - Original Message - From: "Shawn H Corey" To: beginners@perl.org Cc: "Ron Ber

Re: Debugging and passing constant value at run time

2015-07-07 Thread Shawn H Corey
On Tue, 7 Jul 2015 07:27:49 -0700 (PDT) Ron Bergin wrote: > Using a DEBUG constant and assigning its value via an environment > variable are both common, but has a drawback and would not be my > choice of approach. I prefer to use a lexical var (with file scope) > and assign it via command line o

Re: Debugging and passing constant value at run time

2015-07-07 Thread Ron Bergin
Using a DEBUG constant and assigning its value via an environment variable are both common, but has a drawback and would not be my choice of approach. I prefer to use a lexical var (with file scope) and assign it via command line option. Let's assume you have multiple scripts using the DEBUG c

Re: Debugging and passing constant value at run time

2015-07-07 Thread Shawn H Corey
On Tue, 7 Jul 2015 11:40:35 + "Sharanbasappa Raghapur, ERS, HCLTech" 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. > >

Debugging and passing constant value at run time

2015-07-07 Thread Sharanbasappa Raghapur, ERS, HCLTech
Hi, 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 editi