rhxk has asked for the wisdom of the Perl Monks concerning the following question:

Monks, in one of my computer there's a process running that writes data to a shared memory every second.
------ Shared Memory Segments -------- key shmid owner perms bytes nattch stat +us 0x00002f08 8585216 mikes 666 4404 56 0x00001ed7 7110657 mikes 666 8004 1 0x00001ed6 7143426 mikes 666 40404 1 0x0000232e 7176195 mikes 666 9306116 58 0x001a1fa8 8617988 mikes 666 4764 3
This code was developed by someone else in C. And I want to write a perl code/utility to read this shared memory and logs it to a file. Of course I know which shmid to connect to since there's a pattern to create it.

I'm searching to see what's the best way of doing it...any recommendations/directions?...thanx...

Replies are listed 'Best First'.
Re: shared memory
by samtregar (Abbot) on Feb 27, 2007 at 23:46 UTC
    Yuck, IPC shared memory. But if you must, I recommend IPC::ShareLite. That's about as easy as it's going to get!

    -sam

Re: shared memory
by shmem (Chancellor) on Feb 27, 2007 at 23:29 UTC
    Starting points would be perlipc and IPC::SysV.

    --shmem

    _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                  /\_¯/(q    /
    ----------------------------  \__(m.====·.(_("always off the crowd"))."·
    ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
Re: shared memory
by zentara (Cardinal) on Feb 28, 2007 at 13:01 UTC