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" <shawnhco...@gmail.com> To: beginners@perl.org Cc: "Ron Bergin" <r...@i.frys.com> Sent: Tuesday, July 7, 2015 7:41:34 AM Subject: Re: Debugging and passing constant value at run time On Tue, 7 Jul 2015 07:27:49 -0700 (PDT) Ron Bergin <r...@i.frys.com> 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 option. Using a variable has the drawback that the debug code is compiled. Using a constant sub means the debug code is not compiled. -- Don't stop where the ink does. Shawn -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/