shl...@13c2ddb8-3aa7-4284-800b-8db07c650eef  committed 42620a4

Add a note about @ARGV

  • Participants
  • Parent commits 8f951b5

Comments (0)

Files changed (3)

     - Array element: @array[$idx] instead of $array[$idx].
     - using $a and $b as variable names.
     - last/next/redo/etc. without explicit LABELs.
+    - Add a note about using $ARGV[0] and $ARGV[1].
     - abuse of $#array (like $#array + 1 for array length).
     - interpolating strings directly into regex.
         - either comment that you want to accept a regex or use \Q and \E.
-    - Add a note about using $ARGV[0] and $ARGV[1].
 * Link to Fomberg's Hebrew with Perl site.

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

+The same thing holds for unpacking <tt>@ARGV</tt>, the array containing the 
+command-line arguments for a Perl program, or any other array. Don't use 
+<tt>$ARGV[0]</tt>, <tt>$ARGV[1]</tt> etc. directly, but instead unpack 
+<tt>@ARGV</tt> using the methods given above. For processing
+command line arguments, you should also consider using 
+<cpan_self_mod m="Getopt::Long" />.
 <h4 id="clobbering-arrays-or-hashes">Don't clobber arrays or hashes</h4>