|Keep It Simple, Stupid
I haven't used MySQL for many years now (not since I left Lacuna Expanse any way) so I'm by no means an expert either.
I just don't know enough about MySQL's user-defined variables. I would totally expect them to work inside of stored functions. If they work as a part of normal queries as well then it would useful if the DBD::mysql documentation at least mentioned them.