看板 Perl 關於我們 聯絡資訊
請問一下 print"Hellow World \n"; 假設我輸入上面的程式碼 她會在螢幕輸出 Hellow World 那可不可以讓它直接輸出到文字檔 而不是輸出到螢幕呢 謝謝大家. -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.131.69.229
iFEELing: > 04/22 13:38
imce:perl a.pl >1.txt 04/22 14:38
ezman:謝謝你,我知道了 04/24 14:24
itemark:open(file, ">file") || die "$!"; 04/24 17:32
itemark:print file "Hellow World \n"; 04/24 17:33
itemark:close(file); 04/24 17:33
itemark:第一行要補上執行perl的位置 我是用 #!/usr/bin/perl 04/24 17:33