[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Omaha.pm] Another || quickie



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?