blueapache has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl my %Recipes = ( "YumYumStuff" => { ingredients => [ { 1 => "1 Pate a Bombe", 2 => "1/2 French Meringue", 3 => "300ml double cream", 4 => "3 very ripe bananas", 5 => "2 tablespoons Creme de Banane", 6 => "1 Bitter Chocolate Sorbet", }, ], instructions => [ { 1 => "Whisk together the pate a bombe and the Fr +ench Meringue mixtures. They should be roughly equal in amounts by v +olume.", 2 => "Lightly whip the cream to the same consi +stency as the pate de bombe and French Meringue mixture then mix both + mixtures together", 3 => "Finally, whisk in the banana puree and l +iquer. Pour or pipe into ramekins, a long loaf tin or a large freeze +r container. ", 4 => "About 30 mins before serving, transfer t +he parfait from the freezer to the refrigerator", }, ], }, ); for $recipe (keys %Recipes) { print "For $recipe the ingredients are :\n"; $ref = $Recipes{$recipe}{ingredients}; print map "$_ = $ref{$_}\n", sort keys %{$ref}; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How do I print nested hashes
by davido (Cardinal) on Aug 30, 2004 at 08:30 UTC | |
by blueapache (Acolyte) on Aug 30, 2004 at 20:24 UTC | |
|
Re: How do I print nested hashes
by Anonymous Monk on Aug 30, 2004 at 09:14 UTC | |
by blueapache (Acolyte) on Aug 30, 2004 at 20:49 UTC | |
|
Re: How do I print nested hashes
by Eimi Metamorphoumai (Deacon) on Aug 30, 2004 at 15:25 UTC | |
by bobf (Monsignor) on Aug 30, 2004 at 16:03 UTC | |
|
Re: How do I print nested hashes
by chanio (Priest) on Aug 31, 2004 at 17:48 UTC |