chomp成功的返回值是1,chomp对参数去回车符后会改变参数的值,是传入又是传出参数。$arrow_notation = ( chomp( $unpackeing = <STDIN>) );

 

 

     44 my $unpackeing;
     45 my $arrow_notation = '';
     46 print "Enter  name to query, enter exit to exit:\n";
     47 $arrow_notation = ( chomp( $unpackeing = <STDIN>) );
     48 print $arrow_notation." ".$unpackeing; 

 

输入: exit

输出:1 exit

 

其中 $unpackeing 是键盘输入的值exit,$arrow_notation是调用chomp函数的返回值 1.

 

posted @ 2019-06-16 21:55  jimy1  阅读(216)  评论(0编辑  收藏  举报
Total Visits
AmazingCounters.com