in reply to Re: strip perl comment lines
in thread strip perl comment lines

Thanks merlyn. I knew that my strategy would prevent saving a file named 'display', but I wasn't aware of the superior '-' convention. I don't have much experience coding console apps so bear with me. To preserve the context of the replies i won't update the logic of my original code, but did include the warnings you suggested.

Generally, i'm not suggesting that stripping perl comments is a good idea, because it eliminates very valuable documentation and optional lines of code, and is a highly dubious coding situation (parsing perl). However i find it a useful hack when trying to comprehend heavily commented cargo. In some cases it can reduce the script size by 50% and bring the flow of logic into sharper focus.

To future readers of this thread, if you need a perl comment stripper i recommend upgrading to danger's more beautiful and efficient version below.