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

Perl: How to get keys from Hash

Perl: How to get keys from Hash
{filelink=14708}

#!/usr/bin/perl -w
# create an Hash
%myHash = ( "january"  => 31,
          	  "February"  => 28,
              "March" => 31,
              "April"  => 30,
              "May"  => undef );
 # get Keys
@myKeys = keys( %myHash );
# print the keys
foreach $key (@myKeys)
{
    print "$key
";
}
# or, use this
foreach my $key (keys %myHash)
{
    print "$key
";
}

Users who found this page were searching for:

  • perl get key
  • JTable Detail Based on JComboBox Selection
  • java strikethrough text
  • factorial program in perl
  • factorial using recusrion in perl
  • how to open gmail inbox using java code
  • perl print hash keys

No comments yet.

Leave a Comment