in reply to Only using scalers and references
you initiate the hash with %, and add keys with $, which in my book is wickedly confusing.
You're thinking of the big picture while you should be looking at the smaller picture. The sigil is not based on the data structure, it's based on the value being being fetch/set. Hash values are scalars, so "$" is used when fetching/setting hash values.
%hash = ();
I'm surprised you've ever have to do that. Hashes and arrays start off empty. Do you properly scope your hashes and arrays using my? use strict; will identify your most blatant scoping errors (i.e. where you didn't limit the scope at all).
is it ok to program exclusively like this?
Anything abnormal increases the chance of errors and reduces readability.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Only using scalers and references
by stevesnz (Initiate) on Sep 25, 2008 at 06:02 UTC | |
by ikegami (Patriarch) on Sep 25, 2008 at 06:36 UTC | |
by jwkrahn (Abbot) on Sep 25, 2008 at 06:12 UTC | |
by jethro (Monsignor) on Sep 25, 2008 at 13:11 UTC |