Re: need help cleaning up a search
- From: "DJ Stunks" <DJStunks@xxxxxxxxx>
- Date: 26 Jan 2007 20:40:56 -0800
On Jan 26, 8:46 pm, webmas...@xxxxxxxxxxxx (FamiLink Admin) wrote:
Hello all,
I am using the following to pull a search query from a google search:
( my $search1 ) = $url =~ /q=(.*)/;
my $search = (split '&', $search1)[0];
If the search looks at this string:
http://www.google.com/search?hl=en&q=+erika+michelle+barre&btnG=Googl...
Then my search = +erika+michelle+barre
How would I chop off any funny characters (+, %, -, ...) from the front of
the results (and off the end for that mater)
Sometimes there are even +++ before the text I need to get.
Don't re-invent the wheel, URI and URI::QueryParam are core modules.
#!/usr/bin/perl
use strict;
use warnings;
use URI;
use URI::QueryParam;
my $url =
URI->new(q{http://www.google.com/search?hl=en&q=+erika+michelle+barre&btnG=Google+Search});
printf "Search string: '%s'\n", $url->query_param('q');
__END__
-jp
.
- References:
- Use of uninitialized value in string eq
- From: Jen Spinney
- Re: Use of uninitialized value in string eq
- From: Rob Dixon
- need help cleaning up a search
- From: FamiLink Admin
- Use of uninitialized value in string eq
- Prev by Date: need help cleaning up a search
- Next by Date: Re: writing a file in IIS
- Previous by thread: need help cleaning up a search
- Next by thread: Re: need help cleaning up a search
- Index(es):
Relevant Pages
|