Rolf, thanks for the pointers. B::Deparse appears not to be useful here since the PDK compiles the code into an undocumented mash of things - not a pure intermediate code for sure. PerlNET keeps the complete source inside the compiled PerlNET exe or dll target, at least when building with debug information. This is visible when debugging a
PerlNET application, as the debugger can actually show the full source code, calling it a "remote" file, without opening the perl source that was used for the build. I would be content if I could confirm that the non-debug
PerlNET build only stores B code.
perltidy looks promising and we are testing it right now. I will report back when done.
sierpinski, thanks for the comment. As Rolf already indicated, a stripping script can easily handle simple formats, but it becomes fairly complicated to try to handle all cases. And yes, the code is complex, a lot of smarts in the algorithms that need commenting for maintenance, and the code goes through multiple revision/distribution cycles.
JavaFan, the comments may contain material that is not appropriate for public view, either an explanation about a complex and proprietary business logic or personal comments among the dev team members. We need to verify a sanitized code before distribution.
Now, since the debug build of PerlNet contains the source code, and its format is undocumented, I can not risk the content of the release build without a good reference - so I want to strip the comments.
UPDATE: perltidy looks like a great tool, and has a delete all comments option (-dac). I just tried it on my otherwise working script and it gave a fatal
parsing error. It seems the perltidy parser is not 100% the same as perl.
Still, if all else fails I would consider manually simplifying the code to
be compatible with perltidy.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.