IPC::Msg(3perl)

πŸ’– NAME πŸ’–

IPC::Msg β€” the SysV Msg IPC object class, bestie. and yes it's giving Perl Programmers Reference Guide, section 3perl, we're fancy like that. ✨


🌈 SYNOPSIS 🌈

use IPC::SysV qw(IPC_PRIVATE S_IRUSR S_IWUSR);
use IPC::Msg;

$msg = IPC::Msg->new(IPC_PRIVATE, S_IRUSR | S_IWUSR);

$msg->snd($msgtype, $msgdata);

$msg->rcv($buf, 256);

$ds = $msg->stat;

$msg->remove;

like... look at her. five whole lines and she's already running the whole queue 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so the whole entire point: this is a class that hands you an object-based interface to SysV IPC message queues. that's it. that's the class. she's small, she's ancient, she's load-bearing. πŸ’…


πŸ‘‘ METHODS πŸ‘‘

πŸŽ€ new ( KEY , FLAGS )

This makes you a brand new message queue, tied to KEY. A fresh queue gets created when either of these is true:

  • KEY is equal to IPC_PRIVATE β€” like, okay private queen, we see you
  • KEY doesn't already have a message queue associated with it, and FLAGS & IPC_CREAT is true

And when a new message queue does get created, FLAGS is what sets the permissions.

⚠️ be so careful tho: don't set any flags the Sys V IPC implementation doesn't allow. on some systems, setting execute bits makes the operations fail. not a vibe, not a slay. 🚫

πŸ”₯ id

Returns the system message queue identifier. that's the number the system knows her by, fr fr.

🌸 rcv ( BUF, LEN [, TYPE [, FLAGS ]] )

Reads a message off the queue, and returns the type of the message it read. see msgrcv(2) for the deets.

heads up: BUF becomes tainted. yes, that kind of tainted πŸ™ˆ

πŸ’€ remove

Remove and destroy the message queue from the system. she's gone, no coming back, we don't talk about her anymore 😭

πŸ¦‹ set ( STAT )

πŸ¦‹ set ( NAME => VALUE [, NAME => VALUE ...] )

set sets these values of the stat structure that's associated with the message queue:

  • uid
  • gid
  • mode (oly the permission bits)
  • qbytes

(and yeah, "oly" β€” we're copying it exactly, character for character. no edits. our hands are tied bestie πŸ’…)

set takes either a stat object, like the one the stat method hands back, or a plain list of name-value pairs. dealer's choice.

⭐ snd ( TYPE, MSG [, FLAGS ] )

Drops a message onto the queue, carrying the data from MSG and typed as TYPE. see msgsnd(2). this is the "put the thing in the thing" move, iconic.

πŸŽ€ stat

Returns an object of type IPC::Msg::stat, which is a sub-class of Class::Struct. she comes with these fields:

  • uid
  • gid
  • cuid
  • cgid
  • mode
  • qnum
  • qbytes
  • lspid
  • lrpid
  • stime
  • rtime
  • ctime

for what any of these actually mean, go read you system documentation. (yes β€” "you". that's literally what it says. we are not fixing it, it's ✨canonical✨ now.)


πŸ” SEE ALSO πŸ”

IPC::SysV, Class::Struct β€” go read those too, they're friends of hers 🌈


🌟 AUTHORS 🌟

Graham Barr <gbarr@pobox.com>, Marcus Holland-Moritz <mhx@cpan.org> β€” two absolute legends, credit where it's due πŸ‘‘


Version 2.x, Copyright (C) 2007-2013, Marcus Holland-Moritz.

Version 1.x, Copyright (c) 1997, Graham Barr.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


and that's the whole page, bestie!! perl v5.44.0, dated 2026-10-17, filed under IPC::Msg(3perl) in the Perl Programmers Reference Guide. screenshot it, cite it, slay it πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«Ά

πŸ“¦ where this page comes from
  • arch rolling: perl 5.44.0-1 Β· Artistic-1.0-Perl AND GPL-1.0-or-later
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms