in reply to push onto hash!
use perlfunc:ref to see if the value of $somehash{"$foo$bar"} is an arrayref. If it isn't, then create it.
unless ( ref ($somehash{"$foo$bar"} eq 'ARRAY' ) { $somehash{"$foo$bar"} = []; } ...
HTH
Philosophy can be made out of anything. Or less -- Jerry A. Fodor
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(Ovid - don't use 'ref') Re(2): push onto hash!
by Ovid (Cardinal) on Apr 03, 2001 at 20:32 UTC |