Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Win32 Perl-Critic Setup Question

by ddn123456 (Pilgrim)
on May 29, 2008 at 09:08 UTC ( [id://688983]=perlquestion: print w/replies, xml ) Need Help??

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

Dear Monks,

I'm trying to get Perl::Critic running on a Win32 XP SP 2 (Version 5.1.2600) with ActiveState perl, v5.8.6 (MSWin32-x86-multi-thread Binary build 811).

Once Perl::Critic installed I now get this error.

Weak references are not implemented in the version of perl at C:/Perl/site/lib/Perl/Critic/Document.pm line 13

Each time I seem to get stuck on the support for the "weaken".

Has anyone successfully installed and actually used Perl::Critic on Win32? If so, could you please advise?

Many Thanks!!!
ddn123456

Replies are listed 'Best First'.
Re: Win32 Perl-Critic Setup Question
by ikegami (Patriarch) on May 29, 2008 at 09:15 UTC

    Your Scalar::Util needs to be recompiled.

    That's odd, cause the one I have with ActivePerl 5.8.0 and ActivePerl 5.8.8 works:

    >c:\progs\perl580\bin\perl -e"use Scalar::Util qw( weaken ); weaken \$ +a" >c:\progs\perl588\bin\perl -e"use Scalar::Util qw( weaken ); weaken \$ +a"
      Hi Ikegami,

      Many thx for the info.

      When running the line you provided I get:

      perl -e"use Scalar::Util qw( weaken ); weaken \$a"
      Weak references are not implemented in the version of perl at -e line 1
      BEGIN failed--compilation aborted at -e line 1.

      How do you advise to compile Scalar::Util? I'm not so familiar with this.

      Many thanks!
      ddn123456
        Hi,

        Just did the compile procedure with "Scalars::Utils":
        - perl Makefile.PL
        - make
        - make test
        ....t\dualvar.......skipped
        ....all skipped: dualvar requires XS version
        ....t\first.........ok
        ....2/17 skipped: Poor man's MULTICALL can't cope
        ....t\isvstring.....skipped
        ....all skipped: isvstring requires XS version
        ....t\proto.........skipped
        ....all skipped: set_prototype requires XS version
        ....2/23 skipped: Poor man's MULTICALL can't cope
        ....t\weak..........skipped
        ....all skipped: weaken requires XS version
        ....All tests successful, 4 tests and 4 subtests skipped.
        ....Files=35, Tests=331, 3 wallclock secs ( 0.00 cusr + 0.00 csys = 0.00 CPU)

        - make install
        However afterwards the error remains.

        How should I tackle this?

        Thx!
        ddn123456
Re: Win32 Perl-Critic Setup Question
by Herkum (Parson) on May 29, 2008 at 15:05 UTC

    I had all sorts of problems with this, there is a high probability that you 'accidently' installed a version of Scalar::Util that does not have 'weaken'. Actually I am willing to bet that is the case. The Scalar::Util that ActiveState includes is pre-compiled, if you had been using CPAN to update your modules, there is a good chance that you blew the original version away and replaced it with something that does not have weaken.

    The two suggestions I can give you are,

    1. Upgrade your version of Perl, the latest ActivePerl was 5.8.8 (no looking at 5.10 BTW).
    2. Move the Scalar::Util module somewhere and attempt to reinstall the version that's on your system now.
      Hi Herkum,

      Great to hear this.

      Tomorrow morning first thing at the office (working at home now) I'll try out your suggestion un-&re-installing ActiveState.

      Concerning the upgrade I'm a bit blocked since I have to make IT happen with Perl 5.8.6. Taking into account Ikegami's comment about 5.8.0, 5.8.6 ought to support it.

      FYI. On Perl 5.10 it installs and works fine.

      I'll keep you posted further on.

      Many thanks.
      ddn123456
      Hi Herkum,

      After a un-&re-install of ActiveState 5.8.6, installing "Bundle-Perl-Critic" from the ActiveState ppm and then all specific packages it works now.

      Originally I had indeed installed through cpan the "Bundle-Perl-Critic-IncludingOptionalDependencies".

      Re-installing through ActiveState ppm the "Scalars::Util" always got stuck on the XS-part being skipped.

      As of Perl 5.8.8 the MinGW GCC compiler is supported, older versions (such as 5.8.6) still need the Microsoft VC++ compiler (meaning licenses, etcetera).
      There is the tutorial how to achieve this with VC++. I'll test it out soon how to achieve this with VS2005. (The VS2005 is preferable to VS2003 due to VS2003 digital signature restrictions on compiled dll's.)

      Many thanks for sharing your experiences!
      Many thanks to all the other perlmonks who answered!

      Greetings
      ddn123456
        older versions (such as 5.8.6) still need the Microsoft VC++ compiler

        You can use MinGW with older versions of ActivePerl if you install Extutils::FakeConfig and then:
        set perl5opt=-MConfig_m
        This is covered in a little more detail in Compiling C/C++ based Modules under ActiveState using MinGW. I've been using this method with ActivePerl build 806 (perl-5.8.0) with good mileage.

        Cheers,
        Rob
Re: Win32 Perl-Critic Setup Question
by GrandFather (Saint) on May 29, 2008 at 09:21 UTC

    ActiveState have Bundle::Perl::Critic 1.0 available in their ppm repository. Alternatively Perl::Critic 1.082 is available from the Trouchelle repository at http://trouchelle.com/ppm/package.xml


    Perl is environmentally friendly - it saves trees
      Hi,
      Thx! Doing that I also got stuck yesterday on the weaken instruction. :-(
      Thx anyway!!!
      Regards.
      ddn123456
        On my system, I had to use /opt/ActivePerl-5.8/bin/cpan -f Task::Weaken
Re: Win32 Perl-Critic Setup Question
by poolpi (Hermit) on May 29, 2008 at 13:08 UTC

    Try to force the install of Scalar::Util
    See this node

    perl -MCPAN -e shell force install Scalar::Util

    hth,
    PooLpi

    'Ebry haffa hoe hab im tik a bush'. Jamaican proverb
      Hi,

      Thx. Executed your suggestion.

      Got stuck on this XS-version again.
      ....t/weak..........skipped
      ....all skipped: weaken requires XS version.


      Going to try it out this evening on perl 5.10. However here 'm in a prod environment with limited upgrade possibilities.

      Thx to you all for the help.
      ddn123456

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2024-03-28 20:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found