Monday, July 25, 2016

How to Print Array In perl



%metroCity = map { $_ => 1 } qw(MUMBAI HYDERABAD BANGLORE DELHI);
my $myCity = 'HYDERABAD';

if ($metroCity{$myCity}) {
  print " \n\n My City Is: $myCity \n";
}else{
  print " \n\n My City Is not MetroCity \n";    
}