Help for this page

Select Code to Download


  1. or download this
    %author = map  { /^\d{6}$/ ? $_ : [ split( /\|/, $_, 2 ) ] }
              map  { split( /=/, $_, 2 ) } 
              grep { /^\d{6}=[^|]+\|/ } <FH>;
    
  2. or download this
    my %author;
    while (<FH>) {
    ...
        my($l, $r)  = split /=/, $_, 2;
        $author{$l} = [ split /\|/, $r, 2 ];
    }
    
  3. or download this
    my %author;
    while (<FH>) {
        next unless /^(\d{6})=([^|]+?)\|(.*)/;
        $author{$1} = [ $2, $3 ];
    }