in reply to Faced with Null/blank/empty value
Use some default value. How about zero or the empty string or 'N/A'? You're the only one who knows what these values mean, so you'll have to figure out what an appropriate default value might be.
You might use a default() routine:
sub default { return 0 unless( @_ && length $_[0] ); return $_[0]; } $$ref_entry{$1} = default( $2 ) if /^(\w +?)\s+:.(\d+)/; $$ref_entry{$1} = default( $2 ) if /^(\w +?)\s+:.'(.*)'/; $$ref_entry{$1} = default( $2 ) if /^(\w +?)\s+:.>(.*)</
--
TTTATCGGTCGTTATATAGATGTTTGCA
|
|---|