Shlomi Fish avatar Shlomi Fish committed e8cac1a

Add more.

Comments (0)

Files changed (3)

           }
     - Conditional "my"s:
         - my $x if EXPR();
+    - Using one variable for two different purposes
+        - assignment to a different value in the middle of the subroutine.
         - show all with IO::All and without it.
 
 * Add to '/bad-elements/':
-    - Using one variable for two different purposes
-        - assignment to a different value in the middle of the subroutine.
 
 * #perl FAQ:
     - references.

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

 
 </item>
 
+<item id="one_var_for_two_purposes" h="Using One Variable for Two (or More) Different Purposes">
+
+<p>
+Within the scope of its declaration, a variable should serve one purpose, and
+serve it well. One should not re-use a variable for a completely different
+purpose later on in the scope. Creating new variables is cheap in Perl and
+should not be a concern to avoid clarity.
+</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.