With my new found knowledge ... 

my $last_id = $dbh->selectall_arrayref(
    'SELECT id FROM person WHERE name=?',
    undef,
    'martyn',
    )->[0][0];