我在嘗試從文件打印時遇到了一些麻煩。有任何想法嗎?謝謝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