in reply to Re: mmap in Perl?
in thread mmap in Perl?

Thanks for the reply

Btw. did you notice that your indenting didn't quite survive pasting?

No I didnt..

I checked.. and well I do use sync($mmap,1);

Maybe worth a check: There are more mmap modules on CPAN besides File::Map

Well I had a look about, I found one thats good. However coming from a C world I thought of mmap ;) and D-Bus but DBus doesnt have documentation in perl.

My code works! ^^ Thanks

Replies are listed 'Best First'.
Re^3: mmap in Perl?
by jakobi (Pilgrim) on Oct 21, 2009 at 09:25 UTC
    @Robin: The "indenting not surviving paste" refers to the leading whitespace in this code scrap
    > 010: map_file $mmap, $file, '+<'; > 011: if (!defined($mmap)) { print "ERROR!!\n"; } > 012: for(my $i=0;$i<10000;++$i) { $mmap = $i; sync($mmap,1); + } > 013: unmap ($mmap);

    all the statements are at the same level, but your indent above implied differently

    map_file $mmap, $file, '+<'; if (!defined($mmap)) { print "ERROR!!\n";} for(my $i=0;$i<10000;++$i) { $mmap = $i; sync($mmap,1); } unmap ($mmap);
    cu,
    Peter (wondering how he mismanaged his browser to get a duplicate node, but then using it to add the note on indenting here instead of asking for a reap).
Re^3: mmap in Perl?
by jakobi (Pilgrim) on Oct 21, 2009 at 09:29 UTC

    DBUS? Then your question was more a XY question :).

    While I can see shared memory to DBUS, my take of mmap is more about efficiency and accessing files other than with print&sysread. You might wish to post a separate question about DBUS.

    CPAN offers at least one module for this: Net::DBus.

    What I can offer on DBUS is a quick hack I did a while ago: check if I can see & send dbus events and somehow use them with waitcond - a rather primitive dbus example. Note that all I needed was the ability to grep and tail dbus, and thus a bit of glue, shell and an existing dbus monitoring tool was enough to conclude that experiment & obtain a useful but missing DBUS debug tool.