Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
        print "In the function, the key is $key and the value is $val\n";
        $hashref->{$key} = $val;
    }
    
  2. or download this
    $ perl populate_hash.pl
    The array is: sean connery george lazemby roger moore timothy dalton p
    +ierce brosnan
    ...
              'pierce' => 'brosnan',
              'george' => 'lazemby'
            };
    
  3. or download this
    use strict;
    use warnings;
    ...
        $myHash{$key} = $val;
    }
    print Dumper \%myHash;
    
  4. or download this
    $ perl populate_hash.pl
    $VAR1 = {
    ...
              'pierce' => 'brosnan',
              'george' => 'lazemby'
            };