[Dbix-class] Row updates with parameters vs. without

Nathaniel Green nate.green at gmail.com
Tue Apr 6 16:46:09 GMT 2010


Hi all,

I recall reading advice to avoid doing all in one updates like:

$row->update({ attr => 'stuff', foo => 'bar', ultimate_answer => 42 });

in favor of something like:

$row->attr( 'stuff' );
$row->foo( 'bar' );
$row->ultimate_answer( 42 );
$row->update;

The manual seems to default to the latter, but I can't seem to find a
justification. Is this advice correct and if so what are the
advantages?

Thanks,
Nate



More information about the DBIx-Class mailing list