in reply to Only using scalers and references
is it ok...?Maybe, depends and ymmv. :-)
I would note though that
is likely to confuse others. At least give it a better name$hash = {};
I also prefer$hash_ref = {};
I find it reinforces the idea that an array ref is being dereferenced - but that's just me.push @{$array_ref}, 'val';
The often recommended way to pass hashes/arrays to and from subs is as refs. Some would say that if that is the case you may as well start off with refs in the first place. On the other hand, many functions operate on lists and the amount of dereferencing involved could cancel out any benefit.
It depends.
|
|---|