> I knew Jeff would be the first one answering this one, too bad I could not bet on 
>this.

I felt it would have been too obligatory if I had opened the e-mail "Dear Mr. Pinyan," 
:)


> > You copied it incorrectly, or there is a typo in the book:

You're right, I typed it wrong. I am learning extended regexp's and read it as:
  "?" if
  "!" not
  "=" equal
insted of:
  "?" if
  "!" not equal
I probably got it confused with the normal "!=" comparison.


So far this is what I have. It's bulky, but it get's the job done. Comments welcome, 
but no news is good news.

#!/usr/bin/perl

my $num = reverse $ARGV[0];
if ($num =~ /\./) {
  unless ($num =~ /^[0-9]{2}\./) {
      print "Error\n"; exit(1);
  }
}
$num =~ s/([0-9]{3}) (?=\d) (?!\d*\.)/$1,/xg;
print scalar reverse $num;
print "\n";
exit(0);

Thanks,

=-= Robert Thompson

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to