You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: guides/coding_style/perl/style.md
+20-1
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
Perl Code Style Guidelines
2
2
3
+
```perl
3
4
Indentation:
4
5
Tabs should be used to indent all code blocks. Spaces should never be used to indent code blocks. Mixing tabs and spaces results in misaligned code blocks for other developers who prefer different indentation settings.
5
-
6
6
if ($total_hours >= 24) {
7
7
return 1;
8
8
}
@@ -14,27 +14,41 @@ else {
14
14
return 0;
15
15
}
16
16
}
17
+
```
17
18
19
+
```perl
18
20
Comments:
19
21
There should always be at least 1 space between the # character and the beginning of the comment. This makes it a little easier to read multi-line comments:
20
22
# Comments are your friend, they help
23
+
```
21
24
25
+
```perl
22
26
Subroutine & Variable Names:
23
27
Single letter variable names should never be used unlessfor a loop iterator:
28
+
```
24
29
30
+
```perl
25
31
Avoid abbreviations:
26
32
my$ip_addr; ->No
27
33
my$ip_address; ->Yes
34
+
```
28
35
36
+
```perl
29
37
Use underscores to separate words:
30
38
subget_computer_name {
39
+
```
31
40
41
+
```perl
32
42
All subroutine names should be entirely lowercase:
33
43
subupdate_request_state {
44
+
```
34
45
46
+
```perl
35
47
All class variables defined at the top of a .pm file should be entirely uppercase:
0 commit comments