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:
KEYis equal toIPC_PRIVATEβ like, okay private queen, we see youKEYdoesn't already have a message queue associated with it, andFLAGS & IPC_CREATis 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:
uidgidmode(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:
uidgidcuidcgidmodeqnumqbyteslspidlrpidstimertimectime
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 π
π COPYRIGHT π
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