ouch.<br>
<br>
try putting on use warnings when you do my %x = {};<br>
<br>
also, dumping out %x should show a funky key with an undef value.<br>
<br>
my %device = {}; ## this is the same as my %device = ( { } => undef );<br>
$config{$cfg}{device} = \%device; ## a reference to a hash with a reference for a key<br>
$device{$devid}{status} = 'OK'; ## this is ok, auto creates a hash within a hash<br>
<br>
you really should use<br>
<br>
use warnings;<br>
use strict;<br>
<br>
at the top of your perl scripts. it will help catch your errors before they catch you.<br><br><div><span class="gmail_quote">On 4/10/07, <b class="gmail_sendername">Fulko Hew</b> <<a href="mailto:fulko.hew@gmail.com">
fulko.hew@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">On 4/10/07, Rob Janes <<a href="mailto:janes.rob@gmail.com">
janes.rob@gmail.com</a>> wrote:<br>> you're a php guy, right?<br><br>Nope. Never seen PHP in my life... ain't gonna start now!<br><br>> $x = (); is a list assignment to a scalar. scalar conversion results in
<br>> the scalar ($x that is) being assigned the count of the number of items in<br>> the list. 0 or zero.<br>><br>> $x = {}; assigns a reference to an anonymous hash.<br><br>OK, so I was getting frustrated and made a whole lot of transcription
<br>errors to boot. :-(<br><br>The question should have been... whats the difference between:<br><br>%x = (); and<br>%x = {};<br><br>because what fixed my problem was (transcribing correctly this time):<br><br>my %device = {};
<br>$config{$cfg}{device} = \%device;<br>$device{$devid}{status} = 'OK';<br><br>...<br><br>my %device = %{$config{$cfg}{device}};<br>$status = $device{$devId}{status};<br></blockquote></div><br>