作者handsomegirl (薰)
看板perl
标题[问题] format与write
时间Tue Sep 4 15:56:58 2007
想用格式化输出档案,
不过都只能print在cmd window上
什麽方法才可以写到档案里去呢?
附上code
#!usr/bin/perl
format STDOUT_TOP=
Pname Max Min Avg Std Stdplus Stdless
================================================================================
.
format STDOUT=
@>>>>>>>> @##### @#### @#####.#### @#####.#### @#####.#### @#####.####
$_[0],$_[1],$_[2],$_[3],$_[4],$_[5],$_[6]
.
open f,"+<c:\\test\\1\\stastical3.txt";
while(<f>){
chomp;
split(/\s+/);
unshift @value,$_;
($_[0],$_[1],$_[2],$_[3],$_[4],$_[5],$_[6])=split/\s+/;
write ;
}
close f;
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 61.65.55.161
1F:推 iAuEx:用select? 09/05 12:21