【问题标题】:Perl (difference between windows and linux)Perl(windows和linux的区别)
【发布时间】:2011-07-12 12:32:51
【问题描述】:

我在 Ubuntu 中使用以下 Perl 代码没有任何问题,但是当我在 XP 中使用 activeperl 尝试它时,它挂起,没有错误消息,只是一个空白屏幕。在标准 perl 和活动 perl 或 windows 和 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->{results})
  {
   # 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;
}* 

来源:http://www.ibm.com/developerworks/web/library/l-perl-twitter/index.html

-谢谢

【问题讨论】:

  • 我已经看到 perl 对脚本中的行尾感到抓狂。但是,通常它只会显示一条错误消息,而不是挂起解释器。
  • 你应该隔离它挂起的行

标签: windows linux perl activeperl


【解决方案1】:

关于 Windows 特定的 perl 问题有相当广泛的手册页 - perlwin32

脚本使用的只有非核心包是Net::Twitter,在Windows下似乎有很好的测试结果-platform test matrix

【讨论】:

    猜你喜欢
    • 2020-12-01
    • 2020-07-22
    • 2015-01-20
    • 2013-07-20
    • 2021-08-07
    • 1970-01-01
    • 2012-11-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多