I use the following Perl code without any problems in Ubuntu, but when I try it in XP using activeperl it hangs, no error messages, just a blank screen. Are there any issues I should be aware of when moving code between standard perl and active perl or windows and ubuntu?
*sub do_search
{
my $term = shift @_;
my $page = 1;
my @results;
while (scalar @results < $opts{maxresults})
{
my $rset = $handle->search({query=>$term, page => $page, rpp => $opts{rpp} });
print "Searching for $term (page $page)\n" if $opts{verbose};
if (ref $rset eq 'HASH' && exists $rset->{r开发者_运维知识库esults})
{
# break out if no results came back
last unless @{$rset->{results}};
push @results, @{$rset->{results}};
printf "Now we have %d entries\n", scalar @results if $opts{verbose};
}
# go to the next page
$page++;
}
print_post($_) foreach @results;
}*
source:http://www.ibm.com/developerworks/web/library/l-perl-twitter/index.html
-Thanks
There is quite extensive manual page about Windows-specific perl problems - perlwin32.
Only non-core package the script is using is Net::Twitter, which seems to have good test results under Windows - platform test matrix.
精彩评论