On Tue Jan 24 01:22:55 2012, SPROUT wrote:
Show quoted text> On Mon Jan 23 18:43:16 2012, ANDK wrote:
>
> Are you sure 2846acb was responsible? I get this error, which
> suggests da1dff9483 instead:
>
> Can't modify non-lvalue subroutine call at
> /Users/sprout/.cpan/build/Jifty-DBI-0.72-
> ClEIBc/blib/lib/Jifty/DBI/Column.pm line 94.
> BEGIN failed--compilation aborted at t/01records.t line 317.
>
> Line 94 of Column.pm is:
>
> $self->can($_) ? $self->$_($args->{$_}) : $self->attributes-
> >{$_} = $args->{$_};
>
> which is clearly a mistake, as it assigns $args->{$_} to $self-
> >$_($args->{$_}) if $self-
> >can($_).
>
> It should be:
>
> $self->can($_) ? $self->$_($args->{$_}) : ($self->attributes-
> >{$_} = $args->{$_});
>
> or, more clearly:
>
> $self->can($_)
> ? $self->$_($args->{$_})
> : ($self->attributes->{$_} = $args->{$_});
I forgot to add: Perl is not JavaScript. :-) In JavaScript, = and ? : have the same precedence
and are right-associative, but in Perl ? : is higher.