Henrik,
What if I use following code ? logic is same as your program ?
#!/usr/bin/perl
$|=1;
while (<>) {
s|(.*)\?(.*$)|$1|;
print;
next;
}
Regards
Nitesh
On Mon, Oct 27, 2008 at 4:25 PM, Henrik Nordstrom
<henrik_at_henriknordstrom.net> wrote:
>
> Sorry, forgot the following important line in both
>
> BEGIN { $|=1; }
>
> should be inserted as the second line in each script (just after the #! line)
>
>
> On mån, 2008-10-27 at 11:48 +0100, Henrik Nordstrom wrote:
>
> > Example script removing query strings from any file ending in .ext:
> >
> > #!/usr/bin/perl -an
> > $id = $F[0];
> > $url = $F[1];
> > if ($url =~ m#\.ext\?#) {
> > $url =~ s/\?.*//;
> > print "$id $url\n";
> > next;
> > }
> > print "$id\n";
> > next;
> >
> >
> > Or if you want to keep it real simple:
> >
> > #!/usr/bin/perl -p
> > s%\.ext\?.*%.ext%;
> >
> > but doesn't illustrate the principle that well, and causes a bit more
> > work for Squid.. (but not much)
> >
> > > I am still not clear as how to write
> > > help program which will process requests in parallel using perl ? Do
> > > you think squirm with 1500 child processes works differently
> > > compared to the solution you are talking about ?
> >
> > Yes.
> >
> > Regards
> > Henrik
Received on Mon Oct 27 2008 - 11:29:06 MDT
This archive was generated by hypermail 2.2.0 : Mon Oct 27 2008 - 12:00:05 MDT