我有以下代码
#!/usr/bin/perl
use Tie::File;
tie my @last_id, 'Tie::File', 'last_id.txt' or die "Unable to open this file !$i";
print @last_id[0];
exit;
和一个以last_id.txt
类似名称命名的文件
1
2
3
4
5
6
当我运行程序时,没有任何输出。我试过了$last_id[0]
,但还是一无所获。:/
我安装了最新的 ActivePerl。
编辑:
现在我收到Unable to open this file
消息,但该文件与程序源文件存在于同一目录中。