Tutorials
Perl Hash Tables

ASSIGNING HASH VALUES
  • hash tables consist of key/value pairs
  • every key is followed by a value values can be assigned to hash tables as

    %states = ( "California","Sacramento", "Wisconsin","Madison", "New York", "Albany");

    OR

  • of key and value; it uses the => operator to identify the key to the left, and the value to the right; if the => operator encounters bare words in key positions, they will be automatically quoted (note "New York", however, which consists of two words and MUST be quoted
    %states = (California => "Sacramento", Wisconsin => "Madison" , "New York" => "Albany");
    In above example California is key and Sacromento is value.
    Similarily Wisconsin is key and Madison is value.

    Printing:
    print "Capital of California is " . $states{"California"} . "\n\n";
  • Perl
    My First Perl Program
    Perl Scalars
    Perl Lists
    Perl Operators
    Perl Arrays
    Perl Hashes
    Perl If..elsif..else
    @ARGV and %ENV
    Perl Loop statements
    Perl Subroutines
    Perl References
    Perl Regular Expressions
    Perl File Operations
    Perl Objects, Classes
    Perl DBI (Databases)
    Perl Signals
    Perl command line..
    Perl Special Variables
    Perl Reference
    Perl SOAP
    Perl Threads