http://www.perlmonks.org?node_id=1017977


in reply to What version of Strawberry Perl to use?

I just installed Win32::SystemInfo on one of my PCs using Strawberry Perl 5.12.3.

Here's the code that doesn't throw an error (but it certainly does not work):

use Win32::SystemInfo; my %mHash = (TotalPhys => 0, AvailPhys => 0); if (Win32::SystemInfo::MemoryStatus(%mHash)) { print $mHash{TotalPhys}; }

Output: 4294967295 (It doesn't work because total physical memory is 16 GB.)

This code throws a similar but different error to what you described (update: bug 65287):

require Win32::SystemInfo; my %mHash = (TotalPhys => 0, AvailPhys => 0); if (Win32::SystemInfo::MemoryStatus(%mHash)) { print $mHash{TotalPhys}; }

Output: Can't use string ("AvailPhys") as a HASH ref while "strict refs" in use at C:/strawberry/perl/site/lib/Win32/SystemInfo.pm line 231.

I'll try it under Strawberry Perl 5.16 and update this post afterwards.

Updates below...

Build failure under Strawberry Perl 5.16.2.1 reported to the author. Same error you reported above.

It looked to be related to bug 48008 so I changed the source as described. The error went away but new problems cropped up so I updated the bug report.

Replies are listed 'Best First'.
Re^2: What version of Strawberry Perl to use?
by gepebril69 (Scribe) on Feb 11, 2013 at 21:42 UTC

    Thx for the help

    I just noted that my old environment was 5.12.3.0-32bit and my new environment 5.12.3.0-64bit

    My early conclusion is that the problem can lie in the fact that the problem only occurs in the 64bit Strawberry Perl environment, and not the 32 one. I will test it later-on.

      Chad Johnston is working on an update of Win32::SystemInfo. I tested an early version of it a few hours ago and provided some additional patches that appear to fix the remaining 64-bit issues.