G'day ryo0ka,
Your main problem here is that you're ignoring the first argument passed to the class method new() (i.e. Son) and the first argument passed to the object method call() (i.e. $obj).
A secondary problem is that the constructor, new(), should probably be in the Parent class.
Here's a rewrite of your code to demonstrate this:
$ perl -Mstrict -Mwarnings -le '
package Parent;
sub new { bless {} => $_[0] }
sub call { $_[0]->char }
sub char { "parent" }
package Son;
use base "Parent";
sub char { "son" }
package main;
my $parent_obj = Parent->new;
print "Parent object char = ", $parent_obj->call;
my $son_obj = Son->new;
print "Son object char = ", $son_obj->call;
'
Parent object char = parent
Son object char = son
Additional example:
While it's absolutely fine that you've posted minimal code to show your problem,
it occurred to me that the following might be closer to what you were trying to achieve.
$ perl -Mstrict -Mwarnings -le '
package Parent;
sub new { bless {} => $_[0] }
sub call { $_[0]->char }
sub char { ref $_[0] }
package Son;
use base "Parent";
package main;
my $parent_obj = Parent->new;
print "\$parent_obj class = ", $parent_obj->call;
my $son_obj = Son->new;
print "\$son_obj class = ", $son_obj->call;
'
$parent_obj class = Parent
$son_obj class = Son
Note that there is no longer any hard-coded "parent" or "son" strings and that the Son class now has no methods at all; this code now relies entirely on inheritance to return the same information you had previously with two hard-coded char() methods.
See how easy it is to extend the class hierarchy without needing to write a custom char() method for every new subclass:
$ perl -Mstrict -Mwarnings -le '
package Parent;
sub new { bless {} => $_[0] }
sub call { $_[0]->char }
sub char { ref $_[0] }
package Son;
use base "Parent";
package Daughter;
use base "Parent";
package Grandson;
use base "Son";
package main;
my $parent_obj = Parent->new;
print "\$parent_obj class = ", $parent_obj->call;
my $son_obj = Son->new;
print "\$son_obj class = ", $son_obj->call;
my $daughter_obj = Daughter->new;
print "\$daughter_obj class = ", $daughter_obj->call;
my $grandson_obj = Grandson->new;
print "\$grandson_obj class = ", $grandson_obj->call;
'
$parent_obj class = Parent
$son_obj class = Son
$daughter_obj class = Daughter
$grandson_obj class = Grandson