我在尝试从文件打印时遇到了一些麻烦。有任何想法吗?谢谢Perl打开文件问题
open(STDOUT,">/home/int420_101a05/shttpd/htdocs/receipt.html");
#Results of a sub-routine
&printReceipt;
close(STDOUT);
open(INF,"/home/int420_101a05/shttpd/htdocs/receipt.html"); $emailBody = <INF>;
close(INF);
print $emailBody;
ERRORS: Filehandle STDOUT reopened as INF only for input at ./test.c line 6.
print() on closed filehandle STDOUT at ./test.c line 9.
看起来你不需要临时文件,如果你只是打算把它打印到标准输入。 – 2010-04-13 07:06:34
@brian - 基于上面的骨架代码的好点。我猜测第二块只是用于记录/验证,主要目标是在磁盘上获得'receipt.html'。亚历克斯 - 请你澄清一下吗? – DVK 2010-04-13 10:22:10