Use this  in the  loop it might make it easier to see.

foreach my $region ( keys %Regions ) {
     print "Region:\t$region\n" ; 
     print "\t\t @{ $Regions{$region} }\n";
 }
 

-----Original Message-----
From: elavazhagan perl [mailto:[EMAIL PROTECTED] 
Sent: 08 July 2008 12:00
To: Dr.Ruud; [EMAIL PROTECTED]
Cc: beginners@perl.org
Subject: Re: arrayref

Hi......

Thanks Rob,with ur code ,Now I can display all the countries with
regions.Now i would like to display only countries specific to the
region.
We can split the data and assign into two different arrays.Let me know
is
there any specific way to retrive the data ??
Thanks a lot........




#! /usr/perl/bin
use strict;
my %Regions = (
 Europe => [
   'Belgium',
   'Denmark',
   'France',
   'Germany',
   'Great Britain',
   'Hungary',
   'Portugal',
   'Russia',
   'Spain',
   'Sweden',
   'Turkey',
 ],
 Asia => [
   'Australia',
   'China',
   'India',
   'Malaysia',
   'NewZealand',
   'Philippines',
   'South Africa',
   'Taiwan',
   'Vietnam',
 ],
 North => [
   'U.S.',
   'Canada',
   'Mexico',
 ],

 South => [
   'Argentina',
   'Brazil',
   'Venezuela',
 ],
);


 foreach my $countries ( keys %Regions ) {
     print "$countries: @{ $Regions{$countries} }\n"
 }


On 7/8/08, Dr.Ruud <[EMAIL PROTECTED] <[EMAIL PROTECTED]>>
wrote:
>
> "elavazhagan perl" schreef:
>
> > #Start
> > #! /usr/local/perl/bin
> > use strict;
>
> The shebang-line should be the first one.
> "use warnings;" is missing.
>
> --
> Affijn, Ruud
>
> "Gewoon is een tijger."
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> http://learn.perl.org/
>
>
>

Information in this email including any attachments may be privileged, 
confidential and is intended exclusively for the addressee. The views expressed 
may not be official policy, but the personal views of the originator. If you 
have received it in error, please notify the sender by return e-mail and delete 
it from your system. You should not reproduce, distribute, store, retransmit, 
use or disclose its contents to anyone. Please note we reserve the right to 
monitor all e-mail communication through our internal and external networks. 
SKY and the SKY marks are trade marks of British Sky Broadcasting Group plc and 
are used under licence. British Sky Broadcasting Limited (Registration No. 
2906991), Sky Interactive Limited (Registration No. 3554332), Sky-In-Home 
Service Limited (Registration No. 2067075) and Sky Subscribers Services Limited 
(Registration No. 2340150) are direct or indirect subsidiaries of British Sky 
Broadcasting Group plc (Registration No. 2247735). All of the companies 
mentioned in this paragraph are incorporated in England and Wales and share the 
same registered office at Grant Way, Isleworth, Middlesex TW7 5QD.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to