On May 16, Paul said:

>"or" also short circuits, and some consider it more readable, but it
>(and the "and" operator) always return(s) a boolean value, while ||
>(and &&) return the value of the first true expression.
>
>  $a or $b # returns 1 if either has a non-false value, else ''
>  $a || $b # returns $a if nonfalse, else $b if nonfalse, else ''

That is misinformation.

  #!/usr/bin/perl -l

  print (10 || 100);
  print (10 or 100);
  __END__
  10
  10

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
Are you a Monk?  http://www.perlmonks.com/     http://forums.perlguru.com/
Perl Programmer at RiskMetrics Group, Inc.     http://www.riskmetrics.com/
Acacia Fraternity, Rensselaer Chapter.         Brother #734

Reply via email to