3.2. Writing Code

Your code should be as pleasing to the eye as possible, if for no other reason than you should like looking at it and not recoil at the prospect of again diving into an eructation of characters on the screen. And let's face it, programs need all the aesthetic help they can get because their primary purpose is utilitarian. Which of the following subroutines do you prefer?

sub iterate (&$$){
for ($_[1] = 0,my $i = 0;$i <= $_[2];
$_[1] = ++$i/$_[2]){&{$_[0] };
}
}

or

sub iterate (&$$)
   {
   for ($_[1] = 0, my $i = 0;
        $i <= $_[2];
        $_[1] = ++$i / $_[2])
      {
      &{$_[0]};
      }
   }

3.2.1. Style

The only believable comment to make about style is that you should have one. If you aren't already rabidly attached to a particular style, read the

Get Perl Debugged now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.