我在执行Perl脚本时遇到了这个错误。请告诉我如何在Perl中纠正这个错误。
print() on closed filehandle MYFILE
这是导致错误的代码:
sub return_error
{
$DATA= "Sorry this page is corrently being updated...<p>";
$DATA.= "<A href=\"javascript:history.go(-1)\"> Back </A>";
open(MYFILE,">/home/abc/xrt/sdf/news/top.html");
print MYFILE $DATA;
close(MYFILE);
exit;
}
我希望现在我已经更加清楚明白了。