【问题标题】:Bioperl testing error in PerlPerl 中的 Bioperl 测试错误
【发布时间】:2011-01-15 12:56:56
【问题描述】:

这里是新手,我正在尝试在 perl 环境中使用 Bioperl 模块。我的配置是

  • Windows Vista/32
  • 活动 Perl 5.10.1
  • Bioperl 1.6.1
  • Padre 和 Per Studio 2010 IDE

对于安装指南,我查看了BioPerlWiki 并使用了 PPM 方法。我安装成功了。

为了检查 Bioperl 是否正常工作,我进一步关注:

use Bio::Perl;  // Is working without error

但是当我尝试做进一步的检查时

#!C:\Perl\bin
use Bio::Perl;
use strict;
$seq_object = get_sequence('swissprot',"ROA1_HUMAN");
write_sequence(">roa1.fasta",'fasta',$seq_object);

然后我得到错误

Global symbol "$seq_object" requires explicit packages name at c:\.......\example.pl line 4
Global symbol "$seq_object" requires explicit package name at c:\........\example.pl line 5
Execution of C:\...... \example.pl aborted due to compilation erros

我去了c:\perldoc Bio::Perl并知道它的用途,此外我也尝试通过谷歌追踪错误但不知道出了什么问题。

我知道 Perl 和 bioperl 也在系统路径中。谁能指出我犯了哪些愚蠢的错误?

也会询问 bioperl 邮件列表,但我知道他们的回复不像 stackoverflow 这么快

谢谢

【问题讨论】:

  • 除了 eugene 的出色回答之外,您还应该考虑阅读一些关于 perldoc 的基本 Perl 教程(而不是纯粹的 BioPerl 模块文档)——这将为您节省大量时间和麻烦。 perldoc.perl.org/index-tutorials.html

标签: perl bioperl


【解决方案1】:

您可以使用diagnostics pragma 来扩展 Perl 发出的诊断:

use diagnostics;
# your_code

这将为您提供详细的解释:

You've said "use strict" or "use strict vars", which indicates
that all variables must either be lexically scoped (using "my"),
declared beforehand using "our", or explicitly qualified to say
which package the global variable is in (using "::").

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-09-14
    • 2013-02-10
    • 1970-01-01
    • 1970-01-01
    • 2013-06-17
    • 2017-05-08
    • 1970-01-01
    相关资源
    最近更新 更多