Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
$names = Location:G-Canada
$names = Location:Germany
$names = Location:p-Australia
$names = Location:e-Britain
$names = Location:USA
$names = Location:c-India
$names = Location:Netherlands
$names = Location:r-China
my ($location) = $names =~ /Location:(.*)/i; $location= $location=~ /-(.*)/i;
Currently I am doing this to get the Country names. (See some are having c- or r- or something in front of the names). My question is, Is there a better way to do it(in a single code). Thanks in advance Monks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Is there a better way to get the Country names with help of Regax
by Tux (Canon) on Oct 16, 2012 at 05:39 UTC | |
by tobyink (Canon) on Oct 16, 2012 at 05:57 UTC | |
by Anonymous Monk on Oct 16, 2012 at 07:19 UTC | |
by Anonymous Monk on Oct 16, 2012 at 07:17 UTC | |
|
Re: Is there a better way to get the Country names with help of Regax
by 2teez (Vicar) on Oct 16, 2012 at 09:23 UTC |