Here is an example of gvim's syntax highlighting capabilities for the curious:

#!/usr/bin/perl -w
#####################################################
# Script:   mp3_average_year
# Author:   Jeff Anderson
# Date:     03/15/2001
# Comments: finds average year of my mp3 collection
#####################################################

use strict;
use File::Find;
use MP3::Info;

my ($sum,$count);
my $start = shift || '/mnt/lump/mp3';

find sub {
    if (/mp3$/) {
        my $tag  = get_mp3tag($_);
        my $year = $tag->{'YEAR'};
        next unless $year =~ /^\d+$/;
        next unless ($year > 1950 and $year < 2002);
        $sum += $year;
        $count++;
    }
}, $start;

print "$sum / $count = " . $sum / $count . "\n";

UPDATE:
Oh yeah, _PLEASE_ don't actually do what i just did and actually post gvim rendered HTML, as the resulting HTML increases in size tenfold. Guess that makes me a hypnotist.

jeffa

i liked it better than cats, i will use gvim again and again ...


In reply to (jeffa) 2Re: Comments in my code (gvim syntax highlighting example) by jeffa
in thread Comments in my code by s0ttle

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.