in reply to Re^2: HTML::Strip returning blank value after parsing
in thread HTML::Strip returning blank value after parsing

As you can see here, $field is reduced in length (some tags are eliminated), so $string clearly isn't blank. original length 294, new length 267

#!/usr/bin/perl -- use strict; use warnings; use Data::Dump qw' dd '; use HTML::Strip; my $field = qq(<p>With a solid oak top and white painted legs, the New + England Side Table compliments any interior design scheme. This styl +ish side table comprises a magazine shelf and fluted detailing to the + legs.</p> <p>The perfect partner to our New England Coffee Table.</p +> <p><br />H43cm L51cm W41cm</p>); dd length $field; $field = html_parsing( $field ); dd length $field; 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; } __END__ 294 267

Replies are listed 'Best First'.
Re^4: HTML::Strip returning blank value after parsing
by jaspreet_sethi5875 (Initiate) on Jan 16, 2013 at 16:57 UTC
    Even am getting valid value of $field(not blank) when i'll execute it as a single record but the problem lies when am fetching 25k-40k records in a single go from oracle DATABASE.
    Below is the perl suedo code mentioning the problem :
    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

      Below is the perl suedo code mentioning the problem :

      Once again, that is not any different from your previous postings -- it shows no problem

      I'm not sure what you're expecting