Shlomi Fish avatar Shlomi Fish committed 8e148c5

Add more.

Comments (0)

Files changed (2)

         - lexical variable initialisation problem.
         - use closures instead.
     - calling too much for the shell for help.
+    - missing semicolons in the last statements of blocks.

src/tutorials/bad-elements/index.html.wml

 
 </item>
 
+<item id="missing-semicolons-at-the-end-of-blocks" h="Missing Semicolons at the end of blocks">
+
+<p>
+The perl interpreter allows one to omit the last trailing semicolon (";") in 
+the containing block. Like so:
+</p>
+
+<bad_code>
+if ( COND() )
+{
+     print "Success!\n";
+     call_routine() \# No semicolon here.
+}
+</bad_code>
+
+<p>
+However, this isn't a good idea, because it is inconsistent, and may cause 
+errors (or obscure failures) if one-or-more statements are added afterwards.
+</p>
+
+<p>
+As a result, you should end every statement with a semicolon (";") even if 
+it’s the last one. A possible exception to this may be single-line and/or
+single-statement blocks like in <pdoc_f f="map">map</pdoc_f>.
+</p>
+
+</item>
+
 </main_list>
 
 #include "bad-elements-sources.wml"
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.