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

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



Jay Hannah wrote:
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');
  }

Oops. $align and $self->align are two separate beasts. $self->align is a semi-permanent thing, $align changes in this chunk of code a couple of times, depending.

So actually I need both and the BEFORE ternary was the cleanest... So I'm back to that now. The circle of life. Apologies to the original author for sophmoric doubt. :)

j




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