sunil9009 has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use strict; use warnings; my %Names = { 'Washington' => { 'name' => ['Eric','Smith'] } 'California' => { 'name' => ['John','Paddy','Josh'] } }; my %Cars = { 'Washington' => 'Honda', 'California' => 'BMW' };
I want the following output
Washington: Eric drives Honda Smith drives Honda California: John drives BMW Paddy drives BMW Josh drives BMW
Please note that each names should be newline. I know that this can be written as "Honda is driven by Eric and Smith" , but my scenario is different. I want the lines to print exactly as stated above. Any help would be greatly appreciated.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: looping multidimensional arrays
by BrowserUk (Patriarch) on Dec 05, 2013 at 08:54 UTC | |
by sunil9009 (Acolyte) on Dec 06, 2013 at 02:06 UTC | |
|
Re: looping multidimensional arrays
by Random_Walk (Prior) on Dec 05, 2013 at 14:15 UTC | |
|
Re: looping multidimensional arrays (the same as not looping them)
by Anonymous Monk on Dec 05, 2013 at 08:48 UTC |