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:

  • how to iterate over a dictionary in python
  • add intme hash perl
  • +Java+how to use PI method
  • perl add hash
  • Python Key Press
  • python load xml document
  • win32 perl output to csv file
  • email header java code
  • python query sql 2008 database
  • perl addItem

No comments yet.

Leave a Comment