in reply to Transpose the entries
Fish.
my %rec = ( cuid => "EMPTY" ); scalar <>; # eat first seperator line. while( <> ) { chomp; if( /^-+$/ ) { print "$rec{username}:$rec{name}:$rec{cuid}\n"; %rec = ( cuid => "EMPTY" ); } else { my( $k, $v ) = split( /:\s*/, $_, 2 ); $rec{ lc $k } = $v; } }
Update: Missed the part about the default.
|
|---|