http://www.perlmonks.org?node_id=1206574
phildeman has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I am unsuccessfully trying to build a Where Clause in DBIx::Class.
The where clause should be:

WHERE status='Review' OR ( ( status='Offered' OR status='Denied' OR status='Cancelled' OR status='Conditional Offer') AND ( sent_email is NULL OR sent_email='0000-00-00') )

I was successful able to produce this Where Clause:

WHERE ( status='Offered' OR status='Denied' OR status='Cancelled' OR status='Conditional Offer') AND ( sent_email is NULL OR sent_email='0000-00-00');

using this snippet of code:

my @proc_requests = $schema->resultset( 'TblRequests' )->search({ -or => [ status => 'Offered', status => 'Denied', status => 'Cancelled', status => 'Conditional Offer', ], -and => [ -or => [ sent_email => {'!=', undef }, sent_email => {'!=', '0000-00-00'} +, ], ], });

All I need is to add is the outer OR for status = 'Review'. Any thoughts on how to
write a DBIx::Class where clause to produce the first Where Clause at the top?

Thanks