如何在我的代码中解决以下错误:
在faStat2第59行的标量赋值中使用未初始化的值。
#!/usr/bin/perl
use strict;
use warnings;
...
$~ = *OUTFILE; #This is the line it is complaining about
my $cmd = $0;
$cmd =~ s#.*/##;
答案 0 :(得分:0)
OUTFILE
应该是单引号,因为如果没有它们,它就是一个裸字,并且前面有*它被视为需要标量的项目。代码应如下所示:
#!/usr/bin/perl
use strict;
use warnings;
...
$~ = 'OUTFILE';
my $cmd = $0;
$cmd =~ s#.*/##;