biohisham has asked for the wisdom of the Perl Monks concerning the following question:
My plan is to use an array element as a key in a hash and this hash would hold an anonymous array member corresponding to a country (Would work on that afterwards).
#!/usr/local/bin/perl use strict; my @continents; my($key, $value); while(<DATA>){ chomp; my($key, $val)=split /:/; push @continents,$key; } print "@continents\n"; __DATA__ Europe:Germany Europe:France Asia:India Europe:Italy Asia:Japan Asia:Indonesia
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Deleting repeating array elements
by johngg (Canon) on Aug 17, 2009 at 22:46 UTC | |
by biohisham (Priest) on Aug 17, 2009 at 23:46 UTC | |
|
Re: Deleting repeating array elements
by toolic (Bishop) on Aug 17, 2009 at 21:27 UTC | |
|
Re: Deleting repeating array elements
by JavaFan (Canon) on Aug 17, 2009 at 21:17 UTC | |
|
Re: Deleting repeating array elements
by bichonfrise74 (Vicar) on Aug 17, 2009 at 21:56 UTC |