package Test;
use strict;
use warnings;
sub new {
my $class = shift;
my $self = {};
bless $self, $class;
return $self;
}
sub getValue {
my $self = shift;
print "\n~~~~~~~~getValue :$self \n";
$self{theValue};
}
sub setValue {
my $self = shift;
my $value = shift;
print "\n~~~~~~~~~~~set value: $self \n";
$self{theValue} = $value;
}
1;
####
Global symbol "%self" requires explicit package name at Test.pm line 15.
Global symbol "%self" requires explicit package name at Test.pm line 22.
####
(F) You've said "use strict" or "use strict vars", which indicates
that all variables must either be lexically scoped (using "my" or "state"),
declared beforehand using "our", or explicitly qualified to say
which package the global variable is in (using "::").