我现在的问题是基于我遇到的有关CSV文件的问题,但它也更一般。查找Perl值是否已初始化的命令
我正在寻找使用类似于Java/Groovy/Gosu中的null问号来确定数组索引是否已被初始化。
我有类似:
for (my i = 0; i < @engVals or i < @frenchVals; i++) {
$csv->print($file, [ $engVals[i] ?: "", , $frenchVals[i] ?: "" ]);
# Where Elvis ops ensure that the array element at i is initialized, and if not stores blank in the CSV
}
你想知道是否有[[定义]](http://perldoc.perl.org/functions/defined.html)? –