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

Theodore Katseres tedkat at gmail.com
Fri Mar 27 10:51:21 PDT 2009


On Fri, Mar 27, 2009 at 12:36 PM, Jay Hannah <jay at jays.net> wrote:

> 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?
>

How about?

$self->align('left') if ($self->align eq 'justify');


-- 
Ted Katseres
     ||=O=||
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/omaha-pm/attachments/20090327/3795202f/attachment.html>


More information about the Omaha-pm mailing list