Your problem is how you copy the data from $VAR1 to %Status. This code works for me:
$VAR1 = {
'1' => {
'1' => {
'EMail' => 'norbert@thnwb.com',
'Name' => 'Norbert Bodkin'
},
'5' => {
'EMail' => 'sue@thnwb.com',
'Name' => 'Sue Soup'
}
},
'2' => {
'3' => {
'EMail' => 'max@thnwb.com',
'Name' => 'Max Grappler'
}
}
};
my %Status = %$VAR1;
my $status;
for $status (keys %Status) {
for (keys %{ $Status{$status} }) {
print $Status{$status}{$_}{'Name'}, br;
}
}
The error message tells you, that instead of a hashref you have a value. If you post the code that copies $VAR1 to %Status, I would be able to help you further.
Also, hashes don't have order. So, if you want to do a sort on keys, you'll need to create a sorted array with those keys.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|