From: martinahansen Date: Mon, 21 Jul 2008 06:58:01 +0000 (+0000) Subject: fixed ugly bug in get_record X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=4ed0b75f146ea4e23bd2ddc0664c25f4feec573c;p=biopieces.git fixed ugly bug in get_record git-svn-id: http://biopieces.googlecode.com/svn/trunk@184 74ccb610-7750-0410-82ae-013aeee3265d --- diff --git a/code_perl/Maasha/Biopieces.pm b/code_perl/Maasha/Biopieces.pm index 589cab9..d375e2d 100644 --- a/code_perl/Maasha/Biopieces.pm +++ b/code_perl/Maasha/Biopieces.pm @@ -5918,7 +5918,7 @@ sub get_record # Returns data structure. - my ( $block, @lines, $line, %record ); + my ( $block, @lines, $line, $key, $value, %record ); local $/ = "\n---\n"; @@ -5932,10 +5932,9 @@ sub get_record foreach $line ( @lines ) { - # ( $key, $value ) = split ": ", $line; # ooops, this one is buggy! - if ( $line =~ /^([^:]+?):\s+(.*)/ ) { - $record{ $1 } = $2; - } + ( $key, $value ) = split ": ", $line, 2; + + $record{ $key } = $value; } return wantarray ? %record : \%record;