abcde has asked for the wisdom of the Perl Monks concerning the following question:
Hello
I am making a help file viewer, that reads POD files. Because POD is often used for Perl help, it highlights any code blocks and C< > spans with Perl syntax highlighting.
However, some of the files (especially the man pages, it seems) use code blocks for things that are not code - so my program tries to highlight URLs, program output, and the command-line arguments synopsis as if they were Perl code. I want to leave these as they are, not highlight them.
So, is there any way to determine whether a block of code is Perl code or not-code, or should I try something else?
I am making a help file viewer, that reads POD files. Because POD is often used for Perl help, it highlights any code blocks and C< > spans with Perl syntax highlighting.
However, some of the files (especially the man pages, it seems) use code blocks for things that are not code - so my program tries to highlight URLs, program output, and the command-line arguments synopsis as if they were Perl code. I want to leave these as they are, not highlight them.
So, is there any way to determine whether a block of code is Perl code or not-code, or should I try something else?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Distinguishing code from not code
by adrianh (Chancellor) on Dec 31, 2005 at 15:58 UTC | |
Re: Distinguishing code from not code
by turo (Friar) on Dec 31, 2005 at 16:09 UTC | |
by abcde (Scribe) on Dec 31, 2005 at 18:01 UTC | |
Re: Distinguishing code from not code
by adamk (Chaplain) on Jan 01, 2006 at 10:07 UTC | |
by qbxk (Friar) on Jan 01, 2006 at 15:44 UTC | |
by Aristotle (Chancellor) on Jan 01, 2006 at 15:50 UTC |
Back to
Seekers of Perl Wisdom