use strict; use warnings; package Music; sub new { my $class = shift; my ($artist, $title, @tracks) = @_; my $ref= {"Artist" => $artist, "Title" => $title, # "Tracks" => [qw(1 2 3)] "Tracks" => [@tracks] }; bless($ref, $class); return $ref; } sub set_music { my $self = shift; print "Enter name of album "; chomp($self->{Artist} = ); print "Enter title of ", $self->{Artist},": "; chomp($self->{Title} = ); print "Enter tracks: "; chomp($self->{"Tracks"} = ); } sub show_music { my $self = shift; print $self->{'Tracks'}->[1],"\n"; print @{$self->{'Tracks'}},"\n"; print "\n"; } 1;