如果不介意用其他的模块,类似的可以用,
Tie::Array::CSV
http://blogs.perl.org/users/joel_berger/2012/02/why-would-i-use-tiearraycsv.html

免去IO的麻烦,直接当作二维数组来操作。

2013/5/15 Li Xiangchen <[email protected]>

> 您说的很对,谢谢~
> 在 Wed, 15 May 2013 21:11:00 +0800,Roger <[email protected]> 写道:
>
>
>  在理:-)
>>
>> Sent from my Sony Xperia(tm) smartphone smartphone
>>
>> 夏凯 <[email protected]> wrote:
>>
>>  On 2013年05月15日 20:04, Anthony WU wrote:
>>>
>>>> use POSIX qw/ceil/;
>>>> @line = <>;
>>>> chomp (@line);
>>>> print join ("\t", @line[$_ * 20 .. $_ * 20 + 20]) . "\n" for
>>>> (0..ceil($#line/20));
>>>>
>>> 其实我想说一点,大家的热情是可以理解的,**不过直接给代码很不好,授人以鱼不
>>> 如授人以渔,他又不是很紧急,应该让他自己去思考,**给他思路就行了。
>>> 否则到时候一大堆简单的需求,要你们给出代码。
>>>
>>> --
>>> 您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。
>>> 要退订此论坛并停止接收此论坛的电子邮件,请发送电子邮件到 
>>> perlchina+unsubscribe@**googlegroups.com<perlchina%[email protected]>
>>> 。
>>> 要向此网上论坛发帖,请发送电子邮件至 [email protected]。
>>> 通过以下网址访问此论坛:http://groups.**google.com/group/perlchina?hl=**zh-CN<http://groups.google.com/group/perlchina?hl=zh-CN>
>>> 。
>>> 要查看更多选项,请访问 
>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>> 。
>>>
>>>
>>>
>>
>
> --
> 使用Opera的电子邮件客户端:http://www.**opera.com/mail/ <http://www.opera.com/mail/>
>
>
> --
> 您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。
> 要退订此论坛并停止接收此论坛的电子邮件,请发送电子邮件到 
> perlchina+unsubscribe@**googlegroups.com<perlchina%[email protected]>
> 。
> 要向此网上论坛发帖,请发送电子邮件至 [email protected]。
> 通过以下网址访问此论坛:http://groups.**google.com/group/perlchina?hl=**zh-CN<http://groups.google.com/group/perlchina?hl=zh-CN>
> 。
> 要查看更多选项,请访问 
> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
> 。
>
>
>

-- 
您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。
要退订此论坛并停止接收此论坛的电子邮件,请发送电子邮件到 [email protected]。
要向此网上论坛发帖,请发送电子邮件至 [email protected]。
通过以下网址访问此论坛:http://groups.google.com/group/perlchina?hl=zh-CN。
要查看更多选项,请访问 https://groups.google.com/groups/opt_out。


回复