Perl Style: Embrace Hashes

  • Until you start thinking in terms of hashes, you’re not thinking in Perl. They can often replace lengthy loops or complex algorithms.
  • Use a hash whenever you want to represent a set, a relation, a table, a structure, or a record.
  • The words `in’, `unique’, `first’, and `duplicate’ should all set off Pavlovian screams of `HASH!’ If you find them in the same sentence as `array’, you’re probably doing something wrong.

Forward to Use Hashes for Sets
Back to Negative Array Subscripts
Up to index

Copyright © 1998, Tom Christiansen All rights reserved.

Tags

Feedback

Something wrong with this article? Help us out by opening an issue or pull request on GitHub