下面代码哪个地方不对?多谢

下面代码哪个地方不对?多谢

下面代码哪个地方不对?多谢
下面一段perl程序哪点不对?
悬赏分:5 - 离问题结束还有 14 天 2 小时
#!c:\perl\bin\perl -w
open(FILE,"config.txt")||die "can't open file";
@config=<FILE>;
print $config[0];
opendir(TEMP,'$config[0]')||die "Can't open ";
@dir=readdir(TEMP);
foreach $file (@dir)
{print "$file\n";}

config.txt内容为:D:\perl
功能:输出D:\perl目录下的文件名
' 吧.
这样子试试~-----------.
这样子试试~
--------------------------------------------------------------------------------------------

#!c:\perl\bin\perl -w
open(FILE,"config.txt")||die "can't open file";
@config=<FILE>;
print $config[0];
$d = chomp $config[0];
opendir(TEMP,'$config[0]')||die "Can't open ";
@dir=readdir(TEMP);
foreach $file (@dir)
{print "$file\n";}