Help for this page

Select Code to Download


  1. or download this
    my @data = (
    qq{key1~key2~key3
    ...
        s/\n(.*)$//;
        %hash = ( %hash, map {$_, $1} split(/~/, $_));
    }
    
  2. or download this
    my %hash = map {
        my @things = split(/~|\n/, $_);
        my $value = pop @things;
        map { $_, $value } @things;
    } @data;