in reply to What version of Strawberry Perl to use?

That particular message usually comes from using a sub designed to be used as an object method as a class method instead.

Quick demo:

use v5.10; use strict; use warnings; { package Local::Class; sub new { my $class = shift; my %self = @_; bless \%self => $class; } sub foo { my $self = shift; return $self->{foo}; } } my $object = Local::Class->new(foo => 42); say $object->foo; my $foo = Local::Class->foo;

So that's what that error message means. It's not especially Perl version dependent though, so I can't imagine upgrading to a newer version of Perl will fix this particular bug.

Though in general I'd always recommend running the latest stable version of Perl possible; currently 5.16.2.

package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name

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

    Thanks for the answer.

    So it is wise to use the latest version of Perl. Even if you have to be compatible. (I never worry to do so with PHP) But it doesn't explain why it refuses to install now and had no problems in the past. See result with perldoc perllocal

    Tue Apr 3 10:36:14 2012: "Module" Win32::SystemInfo * "installed into: C:\strawberry\perl\site\lib" * "LINKTYPE: dynamic" * "VERSION: 0.11" * "EXE_FILES: "
      If php works for you, by all means :)

        I'm sorry if If I was not so clear I meant if I start a new website I instantly take the latest stable release of PHP, I didn't do this with Perl (until now)