View Single Post
  #5  
Old 11-06-2003, 12:52 PM
eric.zarko eric.zarko is online now
Registered User
 
Join Date: 12-31-1969
Location: CA
Posts: 6
Smile

Quote:
Originally posted by kinook
Argh. The editor so helpfully lowercased those strings when they were pasted in (you'll probably want to disable the 'Fixup text case' option in the script editor right-click options dialog when editing PerlScript). The download has been updated with a fix for the typos (except that I couldn't see any formatting difference in the last two lines you mentioned).
I understand how finicky editors can be. I will watch out for it in the future.
As for the formatting difference, the issue is that in C/C++, Java, etc you can do this:
Code:
if(x < 1)
  x = 1;
In perl if you use this syntax you are required to use braces, like so:
Code:
if($x < 1)
{
  $x = 1;
}
In order to allow terser code they allow the modifier ... this is an if, while, etc conditional at the end of a statement, like so:
Code:
$x = 1 if($x < 1);
So, in order to emphasise this, if you break between the statement and the modifier you indent the modifer an extra level, like so:
Code:
$x = 1
  if($x < 1);
It is really minor since whitespace is free, so I wouldn't push another version just because of this. Incidentally this is done this way on lines 599, 743, 746 and 784.
Reply With Quote