这句应该是这样吧
chomp(my @r=@line);

在 2011年1月18日 下午6:31,Jeova Sanctus Unus <[email protected]>写道:

> $li=<STDIN>;
> if ($li eq 'column') {
> $li应该还包含还行符吧?
>
> 在 2011年1月18日 下午6:21,naziwh <[email protected]> 写道:
> > 我今天在这么一个程序的
> > print "please choose a way of output: by column or row?";
> > $li=<STDIN>;
> > if ($li eq 'column') {
> >  print @line;
> > }else {
> >   @r=chomp(@line);
> >   print @r;}
> > 我在输入a b c d e f 六个字符后,输出的结果是6,而不是这六个字符
> > 我想问问是不是与if语句有关?
> >
> >
> > --
> > 您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。
> > 要向此网上论坛发帖,请发送电子邮件至 [email protected]。
> > 要取消订阅此网上论坛,请发送电子邮件至 
> > [email protected]<perlchina%[email protected]>
> 。
> > 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。
> >
>
> --
> 您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。
> 要向此网上论坛发帖,请发送电子邮件至 [email protected]。
> 要取消订阅此网上论坛,请发送电子邮件至 
> [email protected]<perlchina%[email protected]>
> 。
> 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。
>
>

-- 
您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。
要向此网上论坛发帖,请发送电子邮件至 [email protected]。
要取消订阅此网上论坛,请发送电子邮件至 [email protected]。
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。

回复