NET-MQTT-PUB(1)

πŸ“¦ version 1.163170, in alpine 3.24

πŸ’… net-mqtt-pub(1) β€” the group chat, but for MQTT ✨

okay so bestie, welcome to net-mqtt-pub, a Perl script for publishing to an MQTT topic πŸŽ€ (yes, this is section NAME, and yes it's exactly that). It ships as part of the Net::MQTT docs situation, and this page lives in the User Contributed Perl Documentation section. iykyk. πŸ¦‹


⭐ VERSION ⭐

version 1.163170 β€” that's the one, no cap πŸ’œ


✨ SYNOPSIS ✨

two whole modes, pick your fighter:

# messages one per line on stdin
echo message | net-mqtt-pub [options] topic

# message as command line arguments
net-mqtt-pub [options] topic this is a message

like, either you pipe lines in, or you just say the message out loud on the command line. both iconic, both valid 🫢


🌸 DESCRIPTION 🌸

so here's the vibe: this script publishes each line from stdin as an MQTT message on the given topic. that's it. that's the whole personality. every line = one message, one message = one line. slay. πŸ’…


πŸŽ€ OPTIONS πŸŽ€

  • -help β€” prints a brief help message. the lil tl;dr of the situation ✨
  • -man β€” prints the manual page. hi, that's this, you're here, main character energy πŸ‘‘
  • -host β€” the host running the MQTT service. default is 127.0.0.1 (yes, localhost-core 🏠)
  • -port β€” the port of the running MQTT service. default is 1883 πŸ”₯
  • -client-id β€” the client id to use in the connect message. default is 'NetMQTTpm' followed by the process id of the process. so it's like NetMQTTpm + your pid, a little name tag for your connection 🏷️
  • -verbose β€” include more verbose output. without this option the script only outputs errors 😭 so like, if it's quiet, that's on purpose
  • -keepalive NNN β€” the keep alive timer value. defaults to 120 seconds. and for simplicity, it is also currently used as the connection timeout β€” one number, two jobs, multitasking queen πŸ’€
  • -retain β€” set the retain flag on the message. default is not set πŸ™ˆ

πŸ¦‹ SEE ALSO πŸ¦‹


πŸ’€ DISCLAIMER πŸ’€

this is not official IBM code. the author works for IBM but wrote this in their spare time (with permission) for fun. so like, it's a passion project, not a corporate thing, okay? don't @ them with IBM tickets πŸ™ˆ


πŸ’– AUTHOR πŸ’–

Mark Hindess <soft-cpan@temporalanomaly.com> 🫢


this software is copyright (c) 2014 by Mark Hindess.

this is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. so yeah, free software, go off πŸŽ€


and that's a wrap, bestie!! this page brought to you by perl v5.42.2, dated 2026-02-15 β€” go publish some messages, you absolute icon β­πŸ’œπŸ¦‹

πŸ“¦ where this page comes from