Help for this page

Select Code to Download


  1. or download this
    my %index = (firstname => 0,
                 lastname  => 1,
    ...
    
    print "First name (from array1): $array1[ $index{firstname} ]\n";
    print "Address    (from array2): $array2[ $index{address}   ]\n";
    
  2. or download this
    use constant { FIRSTNAME => 0,
                   LASTNAME  => 1,
    ...
    
    print "First name (from array1): $array1[ FIRSTNAME ]\n";
    print "Address    (from array2): $array2[ ADDRESS   ]\n";