Help for this page

Select Code to Download


  1. or download this
    my %states_with_comments =
            map { ((split /=/, $$_[0], 2)[1], 'hurray!') }
    ...
            values %$db;
    
    print "states are: ", (join "; ", sort, keys %states_with_comments), "
    +\n";
    
  2. or download this
    root@orion:/tmp# ./mytest.pl 
    states are: West Virginia; Washington
    
  3. or download this
     
    
    my %states_with_comments =                               # and finnaly
    + we will take keys from hash 
    ...
            map { values %$_ }          # take arrays that are below PR, A
    +K, WA, WV
            values %$db;    #           make list of hashes below numbers 
    +99155, 26134
    
  4. or download this
    my %states_with_comments =
                    grep { warn Dumper({"finally" => $_}); 1; }        
    ...
            map { values %$_ }           
                    grep { warn Dumper({"first step is" => $_}); 1; }
            values %$db;
    
  5. or download this
    root@orion:/tmp# ./mytest.pl 
    $VAR1 = {
    ...
              'finally' => 'hurray!'
            };
    states are: West Virginia; Washington