Help,please...!, I'm dead in the water trying to understand why I'm unable to
reference hash entries in what *I consider* to be a fairly straightforward manner.
Any help/pointer is appreciated.
The hash entries *must* exist because I can reference and print them using a literal
key (or within a foreach loop using the internal variable):
print $device{server1} . "x\n"; # Works fine
However, I CANNOT reference them using a separate variable:
print $device{$_} . "x\n"; # Is failing miserably!!
What's my defect?!?
Thanks in advance...!
Karl K.
EXAMPLE OUTPUT ---
$device{server1}: x1x
$_: xserver1x
Use of uninitialized value at ./devicesWIP line 198.
$device{$_}: xx
PORTION OF EXAMPLE CODE (please let me know if more is needed) ---
print '$device{server1}: x' . $device{server1} . "x\n";
print '$_: x' . $_ . "x\n";
print '$device{$_}: x' . $device{$_} . "x\n";