Re: 問幾個新手的問題orz
※ 引述《Dancer31 (:p)》之銘言:
: 剛開始學perl 覺得它真是種隨性的語言阿XD
: 不過碰到了一些問題 麻煩大家幫一下吧@@
: 1. 開檔我只會用 open FILE, "<input.txt";
: 可是規定要在cmd輸入perl xxx.pl < input.txt
我是超級新手(只學了一個晚上Orz)
你說的是這個嘛?
open(INFILE, "input.txt") or die "Can't open input.txt: $!";
open(OUTFILE, ">output.txt") or die "Can't open output.txt: $!";
open(LOGFILE, ">>my.log") or die "Can't open logfile: $!";
my $line = <INFILE>;
my @lines = <INFILE>;
--
外星人開相簿? 有搞頭嗎?
http://www.wretch.cc/album/selfstrike (since2005/1/20PM5:49)
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.114.55.81
討論串 (同標題文章)