in reply to array/hash - reference and dereference
I'm confused on just what you're trying to do. I'm not sure you aren't as well.
# How to create a hash with keys only?
That's nonsensical. Keys are a way to find a value. You can create a hash of keys whose value is undef or 0 or an empty string or any temporary placeholder you want, but you can't have a "hash with keys only".
@insert = \%hash;
This creates a 1-array whose first element is a reference to an empty hash. I don't think that's what you want to do.
The rest of the code is at least superficially reasonable (if you put %ages before the lines where you try and reference it), but what's the purpose of %hash? What are you wanting to end up with?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: array/hash - reference and dereference
by Anonymous Monk on Jan 09, 2009 at 03:33 UTC | |
by fullermd (Vicar) on Jan 09, 2009 at 04:45 UTC | |
by Anonymous Monk on Jan 09, 2009 at 03:39 UTC |