in reply to Using placeholders in OFFSET clause of SELECT statement

Placeholders are actually allowed (at least in newer versions) but by default DBD::mysql puts quotes around the parameter, and the quotes are not allowed for the OFFSET.
To prevent that, use bind_param() instead:
use DBI qw(:sql_types); $sth->bind_param(1, $offset, SQL_INTEGER);