in reply to Comments in my code

Another thing that will be helpful to you (along with the other's suggestions), is to use an editor that supports syntax hilighting. There are several different ones for several different platforms. Running a Super Search on the monastery will give you several conversations on the matter of perl friendly editors. I personally run 'gvim' on Linux, and have my comments set to a medium grey color. The are still completely readable, but unobtrusive in the code.

HTH

/\/\averick
perl -l -e "eval pack('h*','072796e6470272f2c5f2c5166756279636b672');"

Replies are listed 'Best First'.
(jeffa) 2Re: Comments in my code (gvim syntax highlighting example)
by jeffa (Bishop) on Nov 09, 2001 at 19:49 UTC
    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 ...

      <rant>

      Looking at that reminds me why I hate syntax-colouring editors. And I am indebted to stefp for jogging my memory, by talking about angry fruit salad (on the Paris Perl Mongers list -- this subject came up the other day).

      I know, I know, the colours can be configured, but I still why wonder why a person with a knowledge of psycho-optics and some decent design skills hasn't come up with a default that's useable in the first place. Edward Tufte springs to mind.

      I finally managed to wean my self off Notepad, and use vim in Windows... after having figured out how to turn syntax coloring... off.

      </rant>
      --
      g r i n d e r
        Beauty is indeed in the eye of the beholder, and i must admit that the color scheme i demonstrated pleases my eyes quite well. But, i totally understand where you are coming from, and your link to the Edward Tufte site has inspired me:
        
        #!/usr/bin/perl -w
        
        use strict;
        use constant FOO => 'bar';
        
        my @array = qw(one two three);
        my $scalar = 'when in Rome';
         # some comments
        print "i like Rome\n" if $scalar =~ /Rome/;
        print "no digits\n"   if $scalar !~ /\d+/;
        
        sub foo {
            return 'foo';
        }
        
        
        Needs some more tweaking, but you get the point - if it's the colors themselves that bother, and not the notion of syntax highlighting, then just change them to suite your needs. Here is the pertinant .gvimrc config info:
        hi Normal guifg=#35351d guibg=#fffff3 hi PreProc guifg=#de022a guibg=#fffff3 hi Statement guifg=#8d6b5f guibg=#fffff3 hi Comment guifg=#777777 guibg=#fffff3 hi Identifier guifg=#2c2255 guibg=#fffff3 hi Constant guifg=#0f6d30 guibg=#fffff3 hi Special guifg=#de022a guibg=#fffff3 hi Cursor guifg=#de022a guibg=#c13a30
        Cheers, and thanks for the links!

        jeffa

      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.

      Oh, yes do it.You can't cut text in a gif save using OCR and I wonder which OCR software would be smart enough to deal with angry fruit salads :)
      By the way, how do you dump the html from vi?

      And sure enough, like said grinder below, Tufte books are mandatory reading.

      -- stefp