in reply to Re^2: Parsing un-encoded ampersand in XHTML
in thread Parsing un-encoded ampersand in XHTML

Whow, your script should learn about
use strict; use warnings;
and lexical vars. you should use code and readmore tags, when posting to PM. Back to the quiestion, in your code replace the lines
$search_q = $ENV{'QUERY_STRING'}; $search_q =~ s/\&pg=\d+//;
with
$search_q = $ENV{'QUERY_STRING'}; $search_q =~ s/\&pg=\d+//; $search_q =~ s/&(?!amp;)/&/g;
But it is just a guess.
Boris

Replies are listed 'Best First'.
Re^4: Parsing un-encoded ampersand in XHTML
by ww (Archbishop) on Oct 08, 2004 at 13:58 UTC

    Emphatically SECOND Boris' advise, but also note, running perltidyed vers provided by Arunbear, with warnings ONLY (strict turned off to omit the complaints "...requires explicit package name..."), produces this:

    C:\_wo\pl_test>perl -c amp.pl Name "main::index_loc" used only once: possible typo at amp.pl line 64 +. Name "main::link_target" used only once: possible typo at amp.pl line +171. Name "main::wd" used only once: possible typo at amp.pl line 74. Name "main::docroot_web" used only once: possible typo at amp.pl line +156. Name "main::high_results" used only once: possible typo at amp.pl line + 152. Name "main::page_script" used only once: possible typo at amp.pl line +153. Name "main::grains" used only once: possible typo at amp.pl line 63. amp.pl syntax OK

    Also new, so this may be beside the point, but at a minimum, means you have done (been there, done that) a lot of work that doesn't have a payoff