From: Robert Klemme Date: 2005-02-16T07:09:52+09:00 Subject: Re: evaluation order "Bertram Scharpf" schrieb im Newsbeitrag news:20050213171916.GA31424@homer.bertram-scharpf... > Hi, > > Am Montag, 14. Feb 2005, 01:39:57 +0900 schrieb Robert Klemme: >> while ( line = gets ) ... >> >> Typically, you would need two assignments which is somewhat ugly: >> >> line = gets >> while line >> .... >> line = gets >> end > > There is > > while gets > line = $_.chomp > ... > end > > Bertram That's a special case that works only because gets() does not only return the value but assigns it to $_ as a side effect. In the general case you need two assignments unless you put it into the while condition. Kind regards robert