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.