作者ezman (中庸之道,才是王道)
看板perl
标题[问题] 请问要如何把程式处理完的结果输出到档案呢?
时间Sat Apr 22 13:06:52 2006
请问一下
print"Hellow World \n";
假设我输入上面的程式码
她会在萤幕输出 Hellow World
那可不可以让它直接输出到文字档
而不是输出到萤幕呢
谢谢大家.
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 220.131.69.229
1F:推 iFEELing: > 04/22 13:38
2F:推 imce:perl a.pl >1.txt 04/22 14:38
3F:推 ezman:谢谢你,我知道了 04/24 14:24
4F:推 itemark:open(file, ">file") || die "$!"; 04/24 17:32
5F:→ itemark:print file "Hellow World \n"; 04/24 17:33
6F:→ itemark:close(file); 04/24 17:33
7F:→ itemark:第一行要补上执行perl的位置 我是用 #!/usr/bin/perl 04/24 17:33