Ah, perlref is your friend. To see the difference, look only at the leftmost part of the variable. Simply put, in this line: print $ref{'os'}->{'Linux'}->{'score'};The first part is using a hash %ref, with the key os. (Block out the first arrow and everything that comes later and you'll see what I mean.) Since %ref is not defined at that point, it prints nothing.
On the other hand, in this line: print $ref->{os}{Linux}{score};the first part is using a scalar $ref, and is using an arrow to treat it as a reference -- specifically a hash reference.
As for leaving out the quotes, as of Perl 5.mumble, you don't need to quote strings when they're used as keys to a hash.
GIH (Glad it helped ;-)
In reply to Re: Re: Re: XML::Simple isn't simple!
by VSarkiss
in thread XML::Simple isn't simple!
by r.joseph
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |