This is an older article that I didn't find back via Google search, but helped me to publish correct QoS metrics with valid dev_id and met_id (like seen via DrNimbus) written in Perl.
I tried to have this article, and specially the example, added via a ticket into the Perl SDK documentation, but this failed..
I'm not sure if this is the latest available version.
Note: when using these qos keywords, they will only work if you launch your script via a probe (or your Perl must be a probe, or started via a probe, like logmon or nexec)