请问以下语句是什么意思? 1. use vars qw( $vars ); 2. use lib "."; 3. use strict; 以及这句话是什么意思: $template->process("index.html.tmpl", $vars) || ThrowTemplateError($template->error()); 这里为什么要用||
1..............
Pragma that, given a list of variable names, predeclares all variables in the list, making sure they are available to routines with delayed loading (e.g., routines loaded by the AutoLoader or SelfLoader). This allows you to use the variables under use strict. The vars pragma also disables warnings about typographical errors.
use vars qw($var1 @var2 %var3);
2..............
Permits adding additional directories to Perl's default search path at compile time. The directories are added at the front of the search path.
use lib list;
adds the directories specified in list to @INC.
3..............
Pragma for doing strict error checking within the current block. Can be turned off by prefixing with no:
use strict 'vars';
...
no strict 'vars';
Provides three kinds of restriction:
strict 'refs'
Generates runtime error if you use any symbolic references.
strict 'subs'
Generates compile-time error if you use a bareword identifier that's not a predeclared subroutine.
strict 'vars'
Generates compile-time error if you access a variable that wasn't declared via my, isn't fully qualified, or wasn't imported.
use strict by itself (with no import list) is the most restrictive, causing all possible restrictions to be imposed.