Rk::M->set_sql(maxid => q(select max(m) from m)); my $max = Rk::M->maxid;