Why do it in Perl when SQL was made for that job?
my $sql = qq(SELECT * from notifAlarmEntry ORDER BY datetime WHERE Message = 'WARNING' OR Message = 'OK NOW');
If your message contains more than just
WARNING or
OK NOW you may want to use
Message LIKE 'WARNING%' OR Message LIKE 'OK NOW%'.
Makeshifts last the longest.