Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Wanted: module for syntax highlighting

by jplindstrom (Monsignor)
on Feb 25, 2003 at 01:26 UTC ( #238313=perlquestion: print w/replies, xml ) Need Help??
jplindstrom has asked for the wisdom of the Perl Monks concerning the following question:

I can't find a module for syntax highlighting.

I'm gonna pretty print SQL code on web pages.

Any modules like that? Any favourites?


/J

Replies are listed 'Best First'.
Re: Wanted: module for syntax highlighting
by tachyon (Chancellor) on Feb 25, 2003 at 01:59 UTC

    perltidy will do HTML syntax highlighting for Perl. For SQL you could just use SQL::Parser or maybe SQL::Statement to do the parsing and add color as you see fit. Personally I think:

    SELECT id FROM address_book WHERE username = ? OR private_address IS NULL

    is pretty enough already.

    tachyon

    s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

Re: Wanted: module for syntax highlighting
by zengargoyle (Deacon) on Feb 25, 2003 at 02:34 UTC

    if by 'pretty print' you mean 'colorize', while not Perl Vim does good by me for the coloring part. i even think i remember seeing a macro or example in the distribution for colorizing from the shell.

    but if you want to start writing a module here's what Vim uses as it's guideline, it shouldn't be to hard to check for the special words and wrap them with some color.

Re: Wanted: module for syntax highlighting
by zentara (Archbishop) on Feb 25, 2003 at 14:26 UTC
      What operating system did you want a program for? For windows there is a program in VB which keeps track off all the variables and highlights them along with loop and if statements. To find it just type perl in search in the Visual basic part at http://www.planet-source-code.com

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://238313]
Approved by FoxtrotUniform
Front-paged by broquaint
help
Chatterbox?
[ELISHEVA]: what's curiouser is that the underlying Text::CSV_XS appears to be BOM-friendly
[afoken]: DBD::CSV has a csv_class attribute. You could subclass Text::CSV_XS to handle BOMs, e.g. through File::BOM.
[ELISHEVA]: Text::CSV_XS already can handle boms - see its detect_bom flag
[ELISHEVA]: but it seems that the DBD::CSV layer on top of it doesn't
[afoken]: Also: All other attributes that start with csv_ and are not described above will be passed to Text::CSV_XS (without the csv_ prefix).
[Discipulus]: what about a good 'ol SOPW?
[erix]: Giro d'Italia won by Dumoulin (peccato Nibali)
[ELISHEVA]: csv_detect_bom doesn't work either
[erix]: (SCNR)
[ELISHEVA]: I may have to resort to SOPW - but was hoping that this would be something simple

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2017-05-28 20:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?