package Programmer;
use strict;
use Person4;
our @ISA = qw(Person);

sub _defaultvalues {	       # helper function for new
        my $self = shift;
        my %default = $self->SUPER::_defaultvalues;
        $default{SKILLS} = { java => "ok" };
        return %default;
}

sub skills {                    # additional get/set method
	my( $self, $value ) = @_;
	$self->{SKILLS} = $value if defined $value;
	return $self->{SKILLS};
}

sub skills_as_string {          # additional method
	my( $self ) = @_;
	my $sk = $self->skills;
	my @str = map {
		sprintf( "%s:%s", $_, $sk->{$_} )
	} sort(keys(%$sk));
	return "{" . join(", ", @str) . "}";
}

use overload '""' => \&as_string;
sub as_string {                 # override method
	my( $self ) = @_;
	my $pers = $self->Person::as_string;
	my $skills = $self->skills_as_string;
	return "$pers\t    skills=$skills\n";
}

1;
