summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjoe <joe@FreeBSD.org>2000-10-18 21:57:37 +0000
committerjoe <joe@FreeBSD.org>2000-10-18 21:57:37 +0000
commite1d76cbbc671f4f83aa80b08592f842f4c3e96c0 (patch)
treefda68ab0ea182fe14139e8ff9082eb39dbd0db6b
parent874587c4cdd2ddb3392763189a86e154c0efc9f2 (diff)
downloadFreeBSD-src-e1d76cbbc671f4f83aa80b08592f842f4c3e96c0.zip
FreeBSD-src-e1d76cbbc671f4f83aa80b08592f842f4c3e96c0.tar.gz
Reference Larry Wall's perlstyle man page, and recommend it's use where
entries in this guide don't override it. Requested by: markm Comment on tabulation style.
-rw-r--r--share/man/man7/style.perl.721
1 files changed, 17 insertions, 4 deletions
diff --git a/share/man/man7/style.perl.7 b/share/man/man7/style.perl.7
index 4429f2b..5639bfc 100644
--- a/share/man/man7/style.perl.7
+++ b/share/man/man7/style.perl.7
@@ -150,6 +150,19 @@ or
.Ar script.pl
and produce no warnings.
.Pp
+Indentation is an 8 character tab. Second level indents are four spaces.
+.Bd -literal -offset 0i
+ while (cnt < 20) {
+ z = a + really + long + statement + that + needs +
+ two lines + gets + indented + four + spaces +
+ on + the + second + and + subsequent + lines.
+ }
+.Ed
+.Pp
+Do not add whitespace at the end of a line, and only use tabs
+followed by spaces to form the indentation. Do not use more spaces
+than a tab will produce and do not use spaces in front of tabs.
+.Pp
Opening braces should be at the end of the controlling line. Else
and elsif belong on the same line as the closing brace for the
previous if or elsif block:
@@ -182,10 +195,6 @@ previous if or elsif block:
}
.Ed
.Pp
-Indentation and block style should follow
-.Xr style 9
-where applicable.
-.Pp
Where possible scripts should use standard modules instead of
rewriting the code inline. It may be appropriate in some cases to
import a CPAN module into the base system to facilitate this.
@@ -202,9 +211,13 @@ instead of
.Fa if (! ... )
where it improves readability.
.Pp
+Where it doesn't conflict with this guide read
+.Xr perlstyle 1
+and adopt Larry Wall's style recommendations.
.Sh SEE ALSO
.Xr perlsec 1 ,
+.Xr perlstyle 1 ,
.Xr style 9
.Sh HISTORY
This man page is largely based on the
OpenPOWER on IntegriCloud