B
blaine
Hi,
I'm trying to write perl in windows environment and need to use the
package win32::mmf. Anyhow, I've got some test code below that will
write to the windows namespace but will not retrieve from it. Please
note it's just an example in production I would be writing to the ns
in one script and grabbing from the ns in another.
For some reason the second instance of mmf is not accessing the same
namespace. Any ideas?
my $mmf = Win32::MMF->new( -swapfile => "data.swp",
-namespace => "MyDataShare",
-size => 1024 * 1024 )
or die "\n\n\n\nCan not create namespace";
$mmf->setvar($tokenKey, $hashRef);
print "\n\n " . $mmf->debug();
print "\n\n<BR>--------------";
undef $mmf;
my $mmf = Win32::MMF->new( -swapfile => "data.swp",
-namespace => "MyDataShare",
-size => 1024 * 1024 ,
)
or die "\n\n\n\nCan not create namespace";
print Data:umper->Dump( [ $mmf->getvar($tokenKey) ] );
----
Resulting Output
=== MMF DESCRIPTOR (MMFD) =====================
| MMF size: 1048576 bytes
| No. of variables held in MMF: 1
| MMF Heap: top 1048532
| watermark 89
| bottom 20
+== HEAP STRUCTURE ============================
| blk 36: 53 bytes used
+----------------------------------------------
| blks: 1 used, 0 free, 1 total
| bytes: 53 used, 0 free, 53 total
+== VARIABLE DEFINITIONS ======================
| Var_id Address Size Type
| ccTokenIDValue 36 53 C
=== END OF REPORT =============================
=== MMF DESCRIPTOR (MMFD) =====================
| MMF size: 1048576 bytes
| No. of variables held in MMF: 0
| MMF Heap: top 0
| watermark 0
| bottom 0
+== HEAP STRUCTURE ============================
+----------------------------------------------
| blks: 0 used, 0 free, 0 total
| bytes: 0 used, 0 free, 0 total
+== VARIABLE DEFINITIONS ======================
| Var_id Address Size Type
=== END OF REPORT =============================
I'm trying to write perl in windows environment and need to use the
package win32::mmf. Anyhow, I've got some test code below that will
write to the windows namespace but will not retrieve from it. Please
note it's just an example in production I would be writing to the ns
in one script and grabbing from the ns in another.
For some reason the second instance of mmf is not accessing the same
namespace. Any ideas?
my $mmf = Win32::MMF->new( -swapfile => "data.swp",
-namespace => "MyDataShare",
-size => 1024 * 1024 )
or die "\n\n\n\nCan not create namespace";
$mmf->setvar($tokenKey, $hashRef);
print "\n\n " . $mmf->debug();
print "\n\n<BR>--------------";
undef $mmf;
my $mmf = Win32::MMF->new( -swapfile => "data.swp",
-namespace => "MyDataShare",
-size => 1024 * 1024 ,
)
or die "\n\n\n\nCan not create namespace";
print Data:umper->Dump( [ $mmf->getvar($tokenKey) ] );
----
Resulting Output
=== MMF DESCRIPTOR (MMFD) =====================
| MMF size: 1048576 bytes
| No. of variables held in MMF: 1
| MMF Heap: top 1048532
| watermark 89
| bottom 20
+== HEAP STRUCTURE ============================
| blk 36: 53 bytes used
+----------------------------------------------
| blks: 1 used, 0 free, 1 total
| bytes: 53 used, 0 free, 53 total
+== VARIABLE DEFINITIONS ======================
| Var_id Address Size Type
| ccTokenIDValue 36 53 C
=== END OF REPORT =============================
=== MMF DESCRIPTOR (MMFD) =====================
| MMF size: 1048576 bytes
| No. of variables held in MMF: 0
| MMF Heap: top 0
| watermark 0
| bottom 0
+== HEAP STRUCTURE ============================
+----------------------------------------------
| blks: 0 used, 0 free, 0 total
| bytes: 0 used, 0 free, 0 total
+== VARIABLE DEFINITIONS ======================
| Var_id Address Size Type
=== END OF REPORT =============================