> unless(open(FILE,"<testdir/list.dat")){$error = ."魚"; &error();}

$error = ."魚"
ここで死んでるだけだと思われ

use strict;
use warnings;
くらい付けましょう