我正在尝试在for循环中使用break语句,但由于我的Perl代码中也使用了严格子程序,所以我得到了以下错误: Bareword "break" not allowed while "strict subs" in use at ./final.pl line 154. 除了禁用严格子程序外,是否有解决方法? 我的代码格式如下: for my $entry (@array){ if ($string eq "text"){ ...
Bareword "hello" not allowed while "strict subs" in use at script.pl line 3. Execution of script.pl aborted due to compilation errors. 裸字的正确使用 即便开启了use strict "subs"还是有些地方可以使用裸字。 首先,用户自定义的函数名就是裸字。 同样,在提取哈希表元素花括号里也使用了裸字,以及胖...
use strict; my $x = hello; print "$x\n"; 会给出如下错误:Bareword "hello" not allowed while "strict subs" in use at script.pl line 3. Execution of script.pl aborted due to compilation errors. 裸字的正确使用即便开启了use strict "subs"还是有些地方可以使用裸字。
useTie::IxHash; tie(%foo, Tie::IxHash); 它失败了: Bareword"Tie::IxHash"notallowedwhile"strict subs"inuse at /nfs/pdx/home/rbroger1/tmp.pl line4. Executionof/nfs/pdx/home/rbroger1/tmp.pl aborted duetocompilation errors. 我怎么能搭配:: ixhash工作时use strict是吗? Dsolimano的例子工作了。
Bareword "encode_json" not allowed while "strict subs" in use at ./v_hash_2_Jason.pl line 13. Bareword "bless_function" not allowed while "strict subs" in use at ./v_hash_2_Jason.pl line 13. Execution of ./v_hash_2_Jason.pl aborted due to compilation errors. ...
Bareword "IO::File" not allowed while "strict subs" in use at Makefile.PL line 45. Bareword "IO::String" not allowed while "strict subs" in use at Makefile.PL line 45. Bareword "Pod::Escapes" not allowed while "strict subs" in use at Makefile.PL line 45. ...
Bareword "%s" not allowed while "strict subs" in use (F) With "strict subs" in use, a bareword is only allowed as a subroutine identifier, in curly brackets or to the left of the "=>" symbol. Perhaps you need to predeclare a subroutine? perl v5.12.5 Last change: 2012-11-03 8...
Now you get an error message likeBareword ``test_value” not allowed while ``strict subs” in use at ./a6-strictsubs.pl line 3.This is easy to fix, and there are two ways to do it: Use parentheses to make it clear you’re calling a sub. If Perl sees$a = test_value();, it...
Bareword not allowed while "strict subs" in useis one of the common warnings described inPerl Maven tutorial. We need to put single-quotes'around the stringDr Running the script again we get the following: Content-type:text/html Use of uninitialized value $sum2 in subtraction (-) at bank...
Bareword "e" not allowed while "strict subs" in use at - line 1. Execution of - aborted due to compilation errors. $ perl -e 'print qq|&\0eq|' | ./perl -Ilib syntax error at - line 1, near "&eq" Execution of - aborted due to compilation errors. There the lexer produces '&...