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