| [reply] [d/l] |
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.
| [reply] [d/l] [select] |
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 | [reply] [d/l] |
For the benefit of anyone reading this thread, here is a perltidy'd version of the script:
| [reply] [d/l] |
Wow that makes more sense now, I thought it looked messy but was not sure as i only know html css etc, this sort of code baffles me most of the time so i try to avoid it.
The code you are looking at was downloaded and was released in 2002 if that makes a difference to some of the variables etc.
I have to say thankyou again for the help as I am an extreme novice, I'll try working with your suggestions and see how it go's. cheers Nathan.
| [reply] |