script start .... .... select * from table where some condition = some value .... while(around 25k-40k records) { my $field = ''; $field = $h->{'HTML_FIELD'} if(defined($h->{'HTML_FIELD'})); $field = &html_parsing($field) if($field); ##4-5 $field values come blank here while their ##corresponding $h->{'HTML_FIELD'} values ##are well defined in DATABASE with html tags and ##english phrases and ideally should not be blank when ##passed though html parser. } sub html_parsing { my $raw_html = shift; my $hs = HTML::Strip->new(); my $string = $hs->parse( $raw_html ); ## Problem: here the $string is becoming blank after parsing. $hs->eof; return $string; } .... .... script ends