Not to beat a dead horse or anything but I was able to recreate your problem using Mac OSX 10.2.8 using BBEdit_Lite 6.1. However, the same script when created with vi ran just fine. I opened up the one created in BBEdit with vi and saw the ^M characters had munged the whole works. Also, I turned on warnings and got the following message:
bash-2.05a$ comment.pl
use: bad interpreter: No such file or directoryerl
So the problem is the line endings. There are a couple of ways to clean it up. One (unfortunately not available with OSX version of *nix) is the "unix2dos" command. The other method would be to do some sort of Perl (or sed) script to clean up the control characters. I think if you switch \015 (control-M or Carriage Return) for say \012 (control-L or Line Feed), you should be ok. Something along the lines of say:

#!/usr/bin/perl use warnings; use strict; my $in=$ARGV[0]; my $out=$ARGV[1]; open IN, "$in" or die "Can't do it man. $!"; open OUT, ">>$out" or die "Man, I can't do that. $!"; foreach (<IN>) { s/\015/\012/g; print OUT $_; } close IN; close OUT; exit;

I tried this out and it should do the trick. HTH


"Ex libris un peut de tout"

In reply to Re: Comments trouble by nimdokk
in thread Comments trouble by Anonymous Monk

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.