Use of uninitialized value $path in concatenation (.) or string at analysisOs.pl line 69, <file> line 2.

出问题的代码部分,$paths[2]是数组@paths中的元素,元素类似“/usr/lib”(带双引号),把这个元素单独保存到@path数组中,打印出现这个错误,我加了my $path = "";进行初始化而不行,不知道是哪里出现问题?

$path = $paths[2];
push @path_name_1, $path;

print "$path\n";

my $path = ""改成my @path=();这个试试

这只是一个警告,关系不大
https://blog.csdn.net/betalker/article/details/8362730/