I would add an output parameter to the
mystoredprocedure and have the procedure return the id, all in a single operation.
Read the bind_param_inout section of the DBI documentation.
--
print map{chr}unpack(q{A3}x24,q{074117115116032097110111116104101114032080101114108032104097099107101114})