Perl 中的 Bioperl 测试错误

发布于 2024-10-12 11:05:13 字数 1119 浏览 8 评论 0原文

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

  • Windows Vista/32
  • Active 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那么快

谢谢

Newbie here, I am trying to use Bioperl module in the perl environment. My configuration are

  • Windows Vista/32
  • Active Perl 5.10.1
  • Bioperl 1.6.1
  • Padre and Per Studio 2010 IDE

For the installation guideline I went through BioPerlWiki and used PPM method. I installed it successfully.

To check whether Bioperl was working I futher followed:

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

But when I tried to do futher checking like

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

Then I am getting error

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

I went to the c:\perldoc Bio::Perl and know it's uses, further more I tried to trace out errors through google too but dont know what's wrong.

I am aware of Perl and bioperl to be in system path too. Can anyone point me out what stupid mistakes I have been doing?

Will ask to bioperl mailing list too, but I know their reponse is not so fast like stackoverflow

Thank you

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

北方的韩爷 2024-10-19 11:05:13

您可以使用 diagnostics 编译指示来扩展 Perl 发出的诊断信息:

use diagnostics;
# your_code

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

您说过“use strict”或“use strict vars”,这表明
所有变量必须具有词法作用域(使用“my”),
事先使用“我们的”声明,或明确限定说
全局变量位于哪个包中(使用“::”)。

You can use the diagnostics pragma to extend the diagnostics emitted by Perl:

use diagnostics;
# your_code

This will provide you a verbose explanation:

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 "::").
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文