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] };


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

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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.