Help for this page

Select Code to Download


  1. or download this
    chop (%key_hash = map { split /\s*[|]\s*/,$_,2 } grep (!/^$/,<KEY_FH>)
    +);
      ^                             ^  ^  ^    ^ ^            ^      ^
    ...
      |                             |  + - Vertical bar as only member in 
    +character set
      |                             + - Zero or more whitespaces
      + - Should be 'chomp' to remove the trailing newlines
    
  2. or download this
    use strict;
    use warnings;
    ...
    BBB|G|H|I|J
    CCC|1|2|3|4
    DDD|6|7|8|9
    
  3. or download this
    $VAR1 = {
              'CCC' => '1|2|3|4',
    ...
              'DDD' => '6|7|8|9',
              'AAA' => 'B|C|D|E'
            };