in reply to Loop behavior with HTML::TokeParser::Simple
Probably the regex is failing because of the metacharacters in $src. Try s/\Q$src\E/$newsrc/ (untested) to make the regex work.
However, the better solution is to chuck the regex. It replaces $src in its entirety, so a simple $src = $newsrc (or replace both lines with $token->set_attr('src', $newsrc);) would be both easier to maintain and more effective.
HTH
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Loop behavior with HTML::TokeParser::Simple
by WhiteBird (Hermit) on Dec 20, 2003 at 02:52 UTC | |
by Roger (Parson) on Dec 20, 2003 at 07:02 UTC | |
by WhiteBird (Hermit) on Dec 20, 2003 at 22:50 UTC |
In Section
Seekers of Perl Wisdom