Commits

Shlomi Fish committed c2e03e0

Add another bad element.

Comments (0)

Files changed (2)

 
 CURRENT TASKS:
     - Bad elements page:
-        - Non-explicit imports.
-            - hard to track where identifiers come from.
     - Add a page about file/directory-handling :
         - Will share a lot of content with the Sys Admin page.
         - Refer to perldoc -f open and perldoc perlopentut.
         - Preferably every package should be inside one module (except for
         private ones).
         @ DONE [Sun 2013-06-09]
+    - Bad elems: non-explicit imports.
+        - hard to track where identifiers come from.
+        @ DONE [Sun 2013-06-09]
 
 # vim:ft=quicktask:sw=4:ts=4:et

src/tutorials/bad-elements/perl-elements-to-avoid.xml-grammar-vered.xml

 </p>
 
 </item>
+<item xml:id="non_explicitly_imported_symbols">
+<info>
+<title>Non-explicitly-imported symbols</title>
+</info>
+
+<p>
+When importing symbols from packages, it is a good idea to specify the symbols
+that are reported explicitly, so one won't have to wonder where variables are
+coming from. So:
+</p>
+
+<bad_code syntax="perl">
+use MyLib;
+
+print my_function(3,5), "\n";
+</bad_code>
+
+<p>
+Should be replaced with:
+</p>
+
+<code_blk syntax="perl">
+use MyLib qw( my_function );
+
+print my_function(3,5), "\n";
+</code_blk>
+
+</item>
 </section>
 <section xml:id="sources_of_advice">
 <info>