Section B.7. Chapter 8, Built-in Functions


B.7. Chapter 8, Built-in Functions

  • Don't recompute sort keys inside a sort. [Sorting]

  • Use reverse to reverse a list. [Reversing Lists]

  • Use scalar reverse to reverse a scalar. [Reversing Scalars]

  • Use unpack to extract fixed-width fields. [Fixed-Width Data]

  • Use split to extract simple variable-width fields. [Separated Data]

  • Use Text::CSV_XS to extract complex variable-width fields. [Variable-Width Data]

  • Avoid string eval. [String Evaluations]

  • Consider building your sorting routines with Sort::Maker. [Automating Sorts]

  • Use 4-arg substr instead of lvalue substr. [Substrings]

  • Make appropriate use of lvalue values. [Hash Values]

  • Use glob, not <...>. [Globbing]

  • Avoid a raw select for non-integer sleeps. [Sleeping]

  • Always use a block with a map and grep. [Mapping and Grepping]

  • Use the "non-builtin builtins". [Utilities]



Perl Best Practices
Perl Best Practices
ISBN: 0596001738
EAN: 2147483647
Year: 2004
Pages: 350
Authors: Damian Conway

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net