Re: Assigning a variable to hash keys and values
From: John W. Krahn (krahnj_at_acm.org)
Date: 06/29/04
- Next message: Charles Farinella: "newline to <br>"
- Previous message: Philipp Traeder: "Re: Assigning a variable to hash keys and values"
- In reply to: Daniel Falkenberg: "Assigning a variable to hash keys and values"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: beginners@perl.org Date: Tue, 29 Jun 2004 01:01:40 -0700
Daniel Falkenberg wrote:
>
> Hello All,
Hello,
> I currently have a hash of a hash...
>
> > %HoH = (
> > Key1 => {
> > Apple => "Green",
> > Banna => "Yellow",
> > },
> > Key2 => {
> > Carrot => "Orange",
> > Tomoatoe => "Red",
> > },
> > );
>
> How can I assign Key2 to a variable?
my $variable = $HoH{ Key2 };
John
-- use Perl; program fulfillment
- Next message: Charles Farinella: "newline to <br>"
- Previous message: Philipp Traeder: "Re: Assigning a variable to hash keys and values"
- In reply to: Daniel Falkenberg: "Assigning a variable to hash keys and values"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|