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

[Omaha.pm] code change ... good? bad? ugly?



Hmm... I find this use of the ternary operator confusing so I changed it...


BEFORE:

  $align = ( $self->align eq 'justify' ) ? 'left' : $self->align;

AFTER:

  # We've run out of words to fill a full line
  if ($self->align eq 'justify') {
     $self->align('left');
  }


What do you think?


http://github.com/jhannah/pdf-textblock/blob/master/lib/PDF/TextBlock.pm