ishootperls has asked for the wisdom of the Perl Monks concerning the following question:

Im writing a web app similar to perlcritic.com, where a user uploads their source code and after it gets evaluated it displays the source code back to the user in the browser. I love how perlcritic.com uses line numbers and color code italics and such to display the code in the iFrame. Does any one know what Jeffrey Talhammer might have used to achieve this? I tried googling for a possible perl module, but no luck. Thanks Monks.

"An incendiary Perl will solve that problem" :-) - myself
  • Comment on How do I display code using a pretty print type to the browser?

Replies are listed 'Best First'.
Re: How do I display code using a pretty print type to the browser?
by tobyink (Canon) on Aug 15, 2012 at 16:02 UTC

    Syntax::Highlight::Engine::Kate is reasonably good.

    perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'
Re: How do I display code using a pretty print type to the browser?
by influx (Beadle) on Aug 15, 2012 at 15:58 UTC
    I usually use Javascript for that, like prettify, or SyntaxHighlighter. As an example you're welcome to take a look at Pastelyst, which is a Catalyst driven pastebin Here.
Re: How do I display code using a pretty print type to the browser?
by aaron_baugher (Curate) on Aug 15, 2012 at 22:15 UTC

    I've used Text::Highlight for displaying Perl code in HTML. It's pretty straightforward -- wraps certain things like comments, function names, and strings in different CSS classes, which you can then customize to your liking with colors, fonts, etc.

    Aaron B.
    Available for small or large Perl jobs; see my home node.

Re: How do I display code using a pretty print type to the browser?
by ishootperls (Novice) on Aug 15, 2012 at 21:06 UTC

    Thanks guys, I appreciate your suggestions. Im looking in to these right now.

    "An incendiary Perl will solve that problem" :-) - myself