I realise it's not a Perl answer, but if you're getting the record from a database you may find that the database engine can do this work for you.
AFAIK, all the major platforms include functions to allow you to compare, add and subtract dates/times.
A simple query like
select 1
where $my_date_time > $start_date_time
and $my_date_time < $end_date_time
might be sufficient.
If your database record stores only times, not dates/times, you might get some mileage from looking into your database platform's commands for adding hours/minutes to the current time.
A second, perhaps equally unhelpful suggestion:
As you've doubtless discovered, 22:40 may or may not be between 22:00 and 04:00, depending on whether or not you infer 'on the same day'. If it's within your power to do so, perhaps it might be a good idea to alter the way the start/end times are stored in the database - perhaps storing the start time in conventional 24h clock notation(22:00), but then showing the duration of the task by specifiying a number of minutes (or hours, or nanoseconds - whatever unit suits best) after the start.
So, instead of
start | end
-----------
22:00 | 04:00
you'd have
start | end_after_minutes
----------------
22:00 | 360
Not only would it then be straightforward to calculate the start and end datetime values in the database (and so carry out the comparison you're after), but you'd also be able to specify tasks which last for more than 24 hours.