in reply to Re^2: print inside while using HTML::TokeParser::Simple;
in thread print inside while using HTML::TokeParser::Simple;

I don't understand your question, then. You said you want to rewrite the file with new data, and you don't want to append. Now you're saying you don't want the file overwritten. What exactly are you trying to accomplish?
  • Comment on Re^3: print inside while using HTML::TokeParser::Simple;

Replies are listed 'Best First'.
Re^4: print inside while using HTML::TokeParser::Simple;
by daseme (Beadle) on Apr 28, 2005 at 22:26 UTC
    my blame...i want to rewrite the file with the new data, yes. however the above code writes an empty file for some reason.

    edited garbage from post...working solution follows.

    my @BuildToke=(); while ( my $token = $stream->get_token ) { if (( $token->is_comment and $token->as_is eq '<!--Sta +rt FULL TEXT-->') .. ($token->is_comment and $token->as_is eq '<!--End FULL TEX +T-->')){ $newcontent = $token->as_is; #if $token->is_text; push @BuildToke,$newcontent; } } open FH, ">", $file or die "Error opening for overwrite $file: $!\n"; print FH @BuildToke; close FH; } } exit(0);