Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Hi xiper, thanks for the positive feedback and excellent suggestions!

I have added the tie() interface to my module and released version 0.05 to CPAN, plus I have fixed a bug with MMF memory allocation and recycling, and fixed a bug with variable deletion.

The following is what you can do with the new version:
- Everything you can do with version 0.04, plus ... use strict; use warnings; use Data::Dumper; use Win32::MMF::Shareable qw/Debug/; # Must initialize namespace before use Win32::MMF::Shareable::Init( -namespace => 'MySharedmem' ); # Tie variables to shared namespace tie my $shared, "Win32::MMF::Shareable", '$shared'; tie my @shared, "Win32::MMF::Shareable", '@shared'; tie my %shared, "Win32::MMF::Shareable", '%shared'; tie my $sh2, "Win32::MMF::Shareable", '$shared'; tie my @sh2, "Win32::MMF::Shareable", '@shared'; tie my %sh2, "Win32::MMF::Shareable", '%shared'; # as scalar $shared = "Hello world"; # as list @shared = (); for (0..3) { $shared[$_] = "$_" x ($_ + 1); } # as hash %shared = @shared; Debug(); print Dumper(\@sh2), "\n"; print Dumper(\%sh2), "\n"; print Dumper(\$sh2), "\n"; # iteration test foreach (sort keys %sh2) { print "$_ => $sh2{$_}\n"; } foreach (sort values %sh2) { print "$_\n"; } # hash slice test my @keys = keys %sh2; my @values = (0 .. $#keys); @sh2{@keys} = @values; print Dumper(\%sh2);

:-)

In reply to Re: Re: Win32::MMF - Memory Mapped File Support for Perl by Roger
in thread (Updated Again) Win32::MMF - Memory Mapped File Support for Perl by Roger

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-03-28 16:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found