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:

  • sun.net.ftp.ftpclient example
  • perl program for factorial of a number
  • Python Key Press
  • perl hash liste
  • java swing animation example
  • python load xml document
  • days difference from today perl
  • python keyboard key press
  • Python Key action: key pressed
  • sun.net.ftp.FtpClient binary

No comments yet.

Leave a Comment