Re: ref / hash problem



Brent Clark am Montag, 1. August 2005 16.42:
> Hi list
>
> I have my data as so (Thanks to Data::Dumper)
>
> 'Grac01' => {
> 'StndRm' => 'Standard Room',
> 'Suite' => 'Suite',
> 'Pent' => 'Penthouse'
> },
>
> My code is as so.
>
> foreach my $roomCode ( keys %{ $ref_hash->{$fileName} }){ # This works
> 100%
>
> foreach be( keys %{ $ref_hash->{$fileName}->{$roomCode} } ){ # Not

What if you omit the "be"?
(do you write "use strict; use warnings" at the top of your script?)

> working print "Ok HERE IT IS $_ <br />\n";

($_ then would contain the key; to get the value, you would use

$ref_hash->{$fileName}->{$roomCode}->{$_};

in the print statement.
)


joe

> }
>
>
> I cant seem to get my second foreach to display the data of
>
> Standard Room, or Suite etc.
>
> If anyone would be kind to help me, it would be most appreciated.
>
> Kind Regards
> Brent Clark
.



Relevant Pages

  • Re: sarg problem
    ... Brent Clark wrote: ... > I seem to have a problem whereby if I type the sarg, ... > Kind Regards ... Try to downgrade sarg to 2.0.5.dfsg-1. ...
    (Debian-User)
  • windows xserver client
    ... Would anyone know of a good and / or it using a windows xserver client. ... Kind Regards ... Brent Clark ... To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org ...
    (Debian-User)
  • Skype Bad, Gizmo Good
    ... an opensource alternative to skype. ... Kind Regards ... Brent Clark ... To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org ...
    (Debian-User)
  • dspam deb ?
    ... Anyone know if there is any Dspam deb packages somewhere on the net. ... Kind Regards ... Brent Clark ... To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org ...
    (Debian-User)