R
Richard Harnden
Irrwahn Grausewitz said:[Leor: using POD to "comment out" Perl code]
[Dan: don't do that]
[Leor: then what?]
[Dan: use goto]
[Arthur: that's even worse]
(e-mail address removed) (Dan Pop) wrote:
[...][...]I prefer the goto method because it works in all the languages I'm
currently using. Well chosen label names make its usage for this
particular purpose obvious.
I'm not a perl expert, but I just have to ask: how do you deal with
the other side effects Arthur mentioned:
AJO> Secondly, 'goto' does NOT remove the offending code from the
AJO> program! It will still be not only parsed, but actually run:
AJO> any 'my' variables in the "commented-out" section will get
AJO> declared, for example. So you'll end up with errors at best,
AJO> and silent bugs at worst.
So ... if you use goto to skip over code that introduces new variables, and
then you later try to use them and your program crashes because either they
aren't there or they contain junk, then surely you didn't comment out
*enough* code.
Or am I missing something ?