From: Martin DeMello Date: 2006-12-21T05:54:40+09:00 Subject: Re: ruby gotchas On 12/20/06, Tom Pollard wrote: > > The point is that 'or' and 'and' have /lower/ precedence than > anything else, so that they can be used to chain complete expressions > together. This is a Perl-ism, to my knowledge and a number of > common Perl idioms are based on this. (...like, 'open(my $handle, > $filename) or die'). I'm a nuby here, but I haven't seen the weak > 'and' and 'or' used much in Ruby - at least, not in the same > circumstances where I'm used to seeing it in Perl code. Think of them as the inverse versions of the postfix "if" and "unless" a = foo.call or puts "died" puts "died" unless a = foo.call a = foo.call and puts "succeeded" puts "succeeded" if a = foo.call martin