- 论坛徽章:
- 0
|
代码是这样的- open (SPRINT, ">${project}/data/sprint_plan.csv" ) || die "cannot write to file ";
- $num = 0;
- foreach (@start_date) {
- # print "end_date = $_ <br>";
- # print join "|", $start_date[$num], $end_date[$num], $num+1, "<br>";
- print "start date = $_ <br>";
- $end = $end_date[$num];
-
- # $sprint_plan = join ",", $num+1, $_, $end_date[$num] ;
- # $sprint_plan = join "|", $_, $num++ ;
- print "end date = $end<br>";
- print SPRINT "$_ | ";
- print SPRINT "$end | ";
- print SPRINT $num++, "\n"
- # print SPRINT "$_|$start|<br>\n";
- # print SPRINT "----------------\n";
- # $num++;
- }
- close (SPRINT);
复制代码 执行之后页面输出这样的信息- start date = 2010-03-04
- end date = 2010-03-14
- start date = 2010-03-15
- end date = 2010-03-25
- start date = 2010-03-26
- end date = 2010-04-05
- start date = 2010-04-06
- end date = 2010-04-18
- start date = 2010-04-19
- end date = 2010-04-27
- start date = 2010-04-28
- end date = 2010-05-08
- start date = 2010-05-09
- end date = 2010-05-19
- start date = 2010-05-20
- end date = 2010-05-30
- start date = 2010-05-31
- end date = 2010-06-10
- start date = 2010-06-11
- end date =
复制代码 但灵异的是文件始终是这样的结果- -bash-3.1# cat /var/www/cgi-bin/new/data/sprint_plan.csv
- | 0
- | 1
- | 2
- | 3
- | 4
- | 5
- | 6
- | 7
- | 8
- 2010-06-11 | | 9
- -bash-3.1#
复制代码 灵异的是,如果把这一行注释掉- # print SPRINT "$end | ";
复制代码 , 就会成这样的结果- -bash-3.1# cat /var/www/cgi-bin/new/data/sprint_plan.csv
- 2010-03-04 | 0
- 2010-03-15 | 1
- 2010-03-26 | 2
- 2010-04-06 | 3
- 2010-04-19 | 4
- 2010-04-28 | 5
- 2010-05-09 | 6
- 2010-05-20 | 7
- 2010-05-31 | 8
- 2010-06-11 | 9
- -bash-3.1#
复制代码 |
|