Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl -wl
    use strict;
    ...
    @empl_lookup{@employee_ids} = @employee_names;
    # Now, you can look up employee names by ID:
    print $empl_lookup{1236};         # Hi there, Jim!
    
  2. or download this
    #!/usr/bin/perl -wl
    use strict;
    ...
    $foo = { map { $a[$_] => $b[$_] } 0..$#a };
    
    print $foo->{key1};     # Prints 'val1'