Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Perl] Learning Hashes
08-13-2010, 10:49 AM
Post: #1
[Perl] Learning Hashes
Code:
#!/usr/bin/perl -w
#
#Hash -- Learning
#Create Hash keys
$hash_key{1} = "This is hash key \"1\" of variable \$hash_key";
$hash_key{2} = "Hash_Key #2";
$hash_key{"P9"} = "Visit P9";
#Create A list of the keys
@hash_list = keys(%hash_key);
#Print Hash keys
print "@hash_list\tThe Keys\n";
#Get hash Values
@hash_values = %hash_key;
#Print Hash Values + Keys
print "@hash_values\tThe Values";

"Character is determined more by the lack of certain experiences than by those one has had."
Friedrich Nietzsche
Visit this user's website Find all posts by this user
Quote this message in a reply
08-13-2010, 11:40 PM
Post: #2
RE: [Perl] Learning Hashes
Very good example !!! THX for share !

There's a fine line between genius and insanity. I have erased this line.
Oscar Levant
There's a fine line between an administrator and black hat hacker. I have erased this line.
Dr DEBCOL
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


 Quick Theme: