Powered by Ajaxy
Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Perl: How to add item to hash

Perl: How to add item to hash
{filelink=14705}

# create an Hash
( "january"  => 31,
          	  "February"  => 28,
              "March" => 31,
              "April"  => 30,
              "May"  => undef );
# get Hash values
foreach $months (keys %myHash)
{
    print "$months=>$myHash{$months}n";
}
# Add item
$myHash{"june"} = 30;
print "After adding an item
";
foreach $months (keys %myHash)
{
    print "$months=>$myHash{$months}n";
}

Users who found this page were searching for:

  • +Java+how to use PI method
  • how to display time in 12 hour format in java
  • perl program for factorial of a number
  • perl addItem
  • sun.net.ftp.FtpClient binary
  • java swing animation example
  • list python select only match
  • perl add item to hash
  • add to perl hash
  • add hash to hash, perl

No comments yet.

Leave a Comment