From caa065f159e017ab92658f08ee5ec6224c2a24be Mon Sep 17 00:00:00 2001 From: martinahansen Date: Mon, 21 Jul 2008 06:31:00 +0000 Subject: [PATCH] corrected an ugly bug in get_record git-svn-id: http://biopieces.googlecode.com/svn/trunk@183 74ccb610-7750-0410-82ae-013aeee3265d --- code_perl/Maasha/Biopieces.pm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/code_perl/Maasha/Biopieces.pm b/code_perl/Maasha/Biopieces.pm index 039536e..589cab9 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, $key, $value, %record ); + my ( $block, @lines, $line, %record ); local $/ = "\n---\n"; @@ -5932,9 +5932,10 @@ sub get_record foreach $line ( @lines ) { - ( $key, $value ) = split ": ", $line; - - $record{ $key } = $value; + # ( $key, $value ) = split ": ", $line; # ooops, this one is buggy! + if ( $line =~ /^([^:]+?):\s+(.*)/ ) { + $record{ $1 } = $2; + } } return wantarray ? %record : \%record; -- 2.39.5