package Student3; sub new {my $class = shift; my $ref = {}; bless($ref, $class); return $ref; } sub set_student {my $self = shift; print "Enter the student's name "; chomp($self->{"Name"}=); print "Enter the student's major "; chomp($self->{"Major"}=); print "Enter the student's course "; chomp($self->{"Course(s)"}=[]); print "Enter the student's address "; chomp($self->{"Address"}=); print "Enter the student's ID number "; chomp($self->{"ID"}=); print "Enter the student's start date "; chomp($self->{"Start_Date"}=); print "Enter the student's tuition "; chomp($self->{"Tuition"}=); } sub show_student { # An instance method my $self = shift; print "Here are the stats for ", $self->{"Name"}, ".\n"; foreach $key (sort(keys %$self)) { printf "%s: %s\n", $key, $self->{$key} unless $self->{$key} eq $self->{"Name"}; } print @{$self->{"Course(s)"}}, "\n"; } sub add_courses { $self = shift; $courses = shift; $self->{"Course(s)"} = [$courses]; } sub drop_courses { } 1;