wors on active perl but not on unix

G

Guest

I am wondering what would cause a code that works in activeperl to not work
in nix particularly to the quote character i.e %22 same code in active perl
get("..%22...%22"); works fine but run on a server gets nothing, is there a
difference in the way perl on a unix server would interprete the quote
character i.e %22 as opposed to active perl on a windows environment?
 
B

Brian McCauley

I am wondering what would cause a code that works in activeperl to not work
in nix particularly to the quote character i.e %22 same code in active perl
get("..%22...%22"); works fine but run on a server gets nothing, is there a
difference in the way perl on a unix server would interprete the quote
character i.e %22 as opposed to active perl on a windows environment?

I can see no reason.

Please post a _minimal_ but _complete_ script to illustrate your
problem.
 
G

Guest

#!/usr/bin/perl

use strict;
use warnings;
use Data::Dumper;
use WWW::Mechanize;


my $total_count = 0;

my @keywords = ('simpsons',
'diehard',
'fantastic+four',
);

foreach my $keywords(@keywords){
my $url
='http://news.google.co.uk/search?q=~"'.$keywords.'&num=100&hl=en&safe=off
&start=0&as_qdr=all&filter=0';



my $mech = WWW::Mechanize->new();


$mech->get($url);
print $mech->uri."\n";
my @links_to_check = grep { $_->url() !~ /google/i}
$mech->find_all_links( url_regex => qr/\./i );





foreach my $links_to_check (@links_to_check)
{
$total_count++;
print "$links_to_check \n";

}

}

print " $total_count news items found \n";


On activeperl I get approx 894 results, while on a server, I get 0 results
 
B

Brian Blackmore

Nospam said:
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
use WWW::Mechanize;
my $total_count = 0;
my @keywords = ('simpsons',
'diehard',
'fantastic+four',
);
foreach my $keywords(@keywords){
my $url
='http://news.google.co.uk/search?q=~"'.$keywords.'&num=100&hl=en&safe=off
&start=0&as_qdr=all&filter=0';
my $mech = WWW::Mechanize->new();
$mech->get($url);

die "Can't fetch: ", $mech->response->status_line unless $mech->success;
print $mech->uri."\n";

What gets printed here?
my @links_to_check = grep { $_->url() !~ /google/i}
$mech->find_all_links( url_regex => qr/\./i );
foreach my $links_to_check (@links_to_check)
{
$total_count++;
print "$links_to_check \n";
}
}
print " $total_count news items found \n";
On activeperl I get approx 894 results, while on a server, I get 0 results

What happens with mech-dump from the server?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top