全球象征需要明确的一揽子名称? 为什么发生这种情况,以及能够造成这一错误的各种案件是什么?
I am building a Web interface to monitor an embedded system. I have built a Perl script which runs remote commands and gathers output from that system. Now what I need is a Web interface which makes ...
全球象征需要明确的一揽子名称? 为什么发生这种情况,以及能够造成这一错误的各种案件是什么?
查阅perldiag:
www.un.org/Depts/DGACM/index_spanish.htm 全球符号“%”要求有明确的包装名称。
(F) You ve说,“使用严格”或“使用严格限变”,这表明所有变量必须具有灵活性(使用“米”或“状态”,事先使用“来源”申报,或明确有资格说,全球变量的组合(使用“:”):”)。
以前的声明还不完整,也可能发生这种情况。
use strict;
sub test;
test()
# some comment
my $x;
否则现在就发出以下错误信息:
my "
Global symbol "$x" requires explicit package name
这一错误不是在“米”声明中,而是在缺失的半殖民地(;
)上,在test()
。
具体地说,为了在你的法典中说明它是什么原因,你需要张贴你的法典。
The error is outputted and your script is stopped because you ve got use strict
or a derivative of it.
The error occurs because your program is calling a variable out of scope.
您本可在次程序/职能范围内使用本人或当地人,但试图在另一程序范围内使用,或在职能要求之外使用。
sub foo{
my $bar=0;
our ($soap) = 1;
}
foo();
print $bar , "
"; # does not work w/ strict -- bar is only in the scope of the function, not globally defined
print $main::bar , "
"; # will run, but won t be populated
print $soap , "
"; # does not work w/ strict -- the package isn t defined
print $main::soap , "
"; # will run and work as intended because of our
事实上,如果你使用<条码>严格使用;条码>,如果你误用<条码>;条码>在发言结尾处,则以下声明(精通)可上<>。 全球象征也要求明确的包装名称。
I am building a Web interface to monitor an embedded system. I have built a Perl script which runs remote commands and gathers output from that system. Now what I need is a Web interface which makes ...
How do I tell what type of value is in a Perl variable? $x might be a scalar, a ref to an array or a ref to a hash (or maybe other things).
When I try a "chdir" with a filehandle as argument, "chdir" returns 0 and a pwd returns still the same directory. Should that be so? I tried this, because in the documentation to chdir I found: "...
I ve read the doc for GetOptions but I can t seem to find what I need... (maybe I am blind) What I want to do is to parse command line like this myperlscript.pl -mode [sth] [inputfile] I can use ...
I m a little confused about what is going on in Perl constructors. I found these two examples perldoc perlbot. package Foo; #In Perl, the constructor is just a subroutine called new. sub new { #I ...
I would like to submit a form to a CGI script localy (w3c-markup-validator), but it is too slow using curl and apache, I want to use this CGI script more than 5,000 times in an another script. and ...
So I m running perl 5.10 on a core 2 duo macbook pro compiled with threading support: usethreads=define, useithreads=define. I ve got a simple script to read 4 gzipped files containing aroud 750000 ...
A Google search yields a number of results - but which ones are the best? The Perl site appears to contain two - perlboot and perltoot. I m reading these now, but what else is out there? Note: I ve ...