http://qs321.pair.com?node_id=315979


in reply to Re: Loop behavior with HTML::TokeParser::Simple
in thread Loop behavior with HTML::TokeParser::Simple

Thank you for the prompt reply. Using the $src = $newsrc works nicely to make the replacement, and the combined $token->set_attr('src', $newsrc); doesn't complain so I'm assuming it works as expected.

I get an odd bit in the next step of my code, though.

print FILE $token->as_is; close FILE;
I'm trying to save it all back to a file and all I get is a 1K file that merely has an end bold HTML tag in it. That's an improvement over before where I was getting an empty file, but I'm still missing something important. Am I getting something wrong in my set_attr call, or am I mis-understanding and misusing the token->as_is part? I'm looking at the documentation for the module, but I'm clueless. Any suggestions are appreciated.