Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Strange errors in CPAN modules when running on Windows 8.1

by schweini (Friar)
on May 21, 2015 at 00:56 UTC ( #1127290=perlquestion: print w/replies, xml ) Need Help??

schweini has asked for the wisdom of the Perl Monks concerning the following question:

I just switched to Windows 8 with Strawberry perl.

So I installed a couple of modules via Stawberry perls cpan, and Im getting errors and warning left and right.

As an example, I am trying to hook up a LeapMotion to perl using the company provided Device::Leap, and get errors like:

Use of uninitialized value $BUFF in string eq at C:/Strawberry/perl/si +te/lib/Device/Leap.pm line 40. substr outside of string at C:/Strawberry/perl/site/lib/Device/Leap.pm + line 115.

Which seems odd, considering that that module is not doing anything fancy - just a bit of socket reading. The authors even explicitly turned on warnings and strict, so they would have seen these errors, too.

Even more shockingly, Im trying to talk to an Arduino using Win32::SerialPort, and I get errors like:

Second Write attempted before First is done at ServoJoy.pl line 55. Use of uninitialized value $written in numeric ne (!=) at C:/Strawberr +y/perl/site/lib/Win32/SerialPort.pm line 1580.

Apart from the fact that serial communications arent working, the "uninitialized value" error seems out-of place for such a popular module.

On a hunch, I tried running the same programs from an elevated command window, but I get the same errors.

Is there something I am missing? Is this a Win8.1 issue? Some new perl version thing?

Edit: For future readers: Most of the issues seem to have disappeared after I switched to 32-bit Strawberry perl. Seems that Win32::SerialPort doesnt like 64bit perl. I would've thought that that isn't an issue anymore, but it is.

Replies are listed 'Best First'.
Re: Strange errors in CPAN modules when running on Windows 8.1
by toolic (Bishop) on May 21, 2015 at 01:08 UTC
    What version of Perl are you using (and what was your previous version)?
    perl -v

    I looked at Device::Leap on CPAN, and there are many passing tests on recent Perl versions. However, there is only one test in the test suite, and it does nothing more than check that the module can be loaded. So, those runtime warnings you get would never be detected by CPAN Testers.

    It is likely you are affected by incompatible changes in a new version of Perl. Check the perldeltas at http://perldoc.perl.org/index-history.html

      This is perl 5, version 20, subversion 2 (v5.20.2) built for MSWin32-x +64-multi-thread

      I was guessing that some regression is biting me, but from what i saw in the Leap.pm source, nothing strange stood out? $BUFF is well-declared, so why would it stop being that all of a sudden?

      Also, I would hope that something as important as Win32::SerialDevice would pass any tests with any new version of perl?

        $BUFF is well-declared, so why would it stop being that all of a sudden?

        It's still "well-declared".
        The warning is not that it has not been declared, but that it has not been assigned a value:
        C:\>perl -wle "my $x; print $x;" Use of uninitialized value $x in print at -e line 1. C:\>perl -wle "my $x; $x = 17; print $x;" 17
        Cheers,
        Rob
Re: Strange errors in CPAN modules when running on Windows 8.1
by Laurent_R (Canon) on May 21, 2015 at 06:35 UTC
    There may also be an error in the way you are using this package or in the parameters you are passing to its functions. But nobody can know since you haven't shown any of your code. BTW, was your code working with a previous version of Perl (or Windows)?
Re: Strange errors in CPAN modules when running on Windows 8.1
by Anonymous Monk on May 21, 2015 at 02:03 UTC

    Which seems odd, considering that that module is not doing anything fancy - just a bit of socket reading.

    Why? Its just a regular everyday most common of warnings Use of uninitialized value

    Apart from the fact that serial communications arent working, the "uninitialized value" error seems out-of place for such a popular module.

    Why? You can give "uninitialized value" to pretty much everything, its very basic

    Also, for "such a popular module" it hasn't been updated since 2010

    2010 is when perl 5.12 came out. since then we've had 5.14, 5.16, 5.18, and 5.20, and 5.22 is about to be released

    The module uses strict+warnings, and new versions of perl can introduce new warnings

    perldeltas

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1127290]
Approved by toolic
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2020-04-08 18:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The most amusing oxymoron is:
















    Results (45 votes). Check out past polls.

    Notices?