Can`t install perl module Crypt::TEA

221 views Asked by At

When I try to install Crypt::TEA module to perl 5.18 on Windows 7, displayed error:

TEA.xs: In function 'XS_Crypt__TEA_crypt': TEA.xs:58:9: error: invalid use of void expression

1

There are 1 answers

0
Schwern On BEST ANSWER

The problem is this line:

    if (SvREADONLY(output) || !SvUPGRADE(output, SVt_PV))
        croak("cannot use output as lvalue");

SvUPGRADE() is a macro with two void operations, it does not return a value. It will croak if it fails. Change it to this:

    if (!SvREADONLY(output)) 
        SvUPGRADE(output, SVt_PV);