All variables should be commented.

Local variables should be separated from function arguments by a
blank line.

Suggested by:	des
This commit is contained in:
joe 2000-10-18 17:25:59 +00:00
parent af23edfcd0
commit 4c9afd32c6

View File

@ -128,6 +128,27 @@ statements at the top of the script as an alternative to using
.Fa vars
declarations.
.Pp
All variables should be commented.
.Bd -literal -offset 0i
sub foo($@) {
my $cmd = shift; # Command to run
my @args = @_; # Arguments to $cmd
}
.Ed
.Pp
Local variables should be separated from function arguments by a
blank line:
.Bd -literal -offset 0i
sub foo($@) {
my $cmd = shift; # Command to run
my @args = @_; # Arguments to command
my $pid; # Child PID
local *PIPE; # Pipe
my $output; # Output from command
}
.Ed
.Pp
Whenever possible code should be run through the code checker
.Nm perl
.Ar -wc