perl 中的vars是perl中的一個(gè)pragma(預(yù)編譯指示符),專門用來預(yù)定義全局變量,這些預(yù)定義后的全局變量在qw()列表中,在整個(gè)引用perl文件中皆可使用,即便使用use strict也不會(huì)報(bào)錯(cuò):
報(bào)錯(cuò)信息:Global symbol "$str" requires explicit package name at ~vars.pl line 3.
Execution of ~vars.pl aborted due to complication errors.
引用use vars后執(zhí)行結(jié)果:
Output :
hello world!
新聞熱點(diǎn)
疑難解答
圖片精選