Changeset 2410
- Timestamp:
- Nov 23, 2004, 1:37:29 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/doc/misc/perlCodeConventions.tex (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/misc/perlCodeConventions.tex
r2409 r2410 1 %%% $Id: perlCodeConventions.tex,v 1.3 1 2004-11-23 23:20:38jhoblitt Exp $1 %%% $Id: perlCodeConventions.tex,v 1.32 2004-11-23 23:37:29 jhoblitt Exp $ 2 2 \documentclass[panstarrs]{panstarrs} 3 3 … … 1117 1117 \end{verbatim} 1118 1118 1119 \subsubsection{Loading Modules} 1120 1121 Modules may be loaded with an optional version requirement. This is 1122 particularly useful for modules that exist in the Perl core but have newer 1123 versions available on CPAN. 1124 1125 \begin{verbatim} 1126 use Foo; # Correct 1127 use Foo 0.02; # Correct 1128 \end{verbatim} 1129 1130 Don't use \code{require} to prevent a module from exporting symbols into the 1131 caller's namespace. Instead, provide \code{use} with an empty parameter list. 1132 1133 \begin{verbatim} 1134 use Foo qw(); # Correct 1135 use Foo (); # Correct 1136 require Foo; # AVOID! 1137 \end{verbatim} 1138 1139 This also works with a minimum module version requirement. 1140 1141 \begin{verbatim} 1142 use Foo 0.02 qw(); # Correct 1143 \end{verbatim} 1119 1144 1120 1145 %------------------------------------------------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.
