[Omaha.pm] Another || quickie

Kenneth Thompson kthompson at omnihotels.com
Fri Aug 19 10:57:12 PDT 2005


So if I understand this correctly:

 

This:

 

    if ($oWkS->{Cells}[$iR][0]) {

      if ($oWkS->{Cells}[$iR][0]->Value != "") {

        $myVar = ($oWkS->{Cells}[$iR][0]->Value)

      }

    }

 

Is the same as this:

 

    if (!$oWkS->{Cells}[$iR][0]) {}

    elsif {$oWkS->{Cells}[$iR][0]->Value == "") {}

    else {

       $myVar = ($oWkS->{Cells}[$iR][0]->Value);

    }

 

Which is shortcut(ed?) as this? :

 

    My $t = (!$oWkS->{Cells}[$iR][0];

    $myVar = ((!$t) || ($t->Value != "") || $t->Value);

 

 

Which appears to work. However, this article (http://tinyurl.com/a3pt7)
seems to say it's bad to do this for assignment and should only be used
for flow control. Do I need to be concerned?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/omaha-pm/attachments/20050819/bd4058e5/attachment.html


More information about the Omaha-pm mailing list