in reply to Weeding out comments ?
No matter how many times you call a subroutine, it will only be parsed by the Perl interpreter once (unless it is eval'ed for each call). So removing the comments won't help.
The way the Perl interpreter works is that it goes through your program once, parsing and executing BEGIN blocks and building a parsed version of your code. This parsed version is then executed. This parsed version is a data structure that represents a "closer-to-the-metal" (and optimized) version of the code, and does not include comments. You can see it using B::Deparse.
In short, if your concern is about speed, you don't have to remove comments yourself, the interpreter does it for you, once per script.
|
|---|