From aa9061a17f9d8556fbb9bac67f373b2bd12b82e2 Mon Sep 17 00:00:00 2001 From: joe Date: Wed, 18 Oct 2000 17:25:59 +0000 Subject: [PATCH] All variables should be commented. Local variables should be separated from function arguments by a blank line. Suggested by: des --- share/man/man7/style.perl.7 | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/share/man/man7/style.perl.7 b/share/man/man7/style.perl.7 index c1a03d002514..e1387a118fe8 100644 --- a/share/man/man7/style.perl.7 +++ b/share/man/man7/style.perl.7 @@ -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