package Fish;

# making constants

my $FISHNAME='Goldfish';

# Making the constructor

sub new {

	my($class,%param)=@_;
	
	# This is a special variable where all our variables will live...
	my $self={};
	
	# We take fishtype as a parameter, or if we don't get given a parameter,
	# then we just use FISHNAME

	my $fishtype=$param{name} || $FISHNAME;

	# Fishtype would disappear as soon as left the subroutine, so we put 
	# it in the $self special variable...

	$self->{'fishtype'}=$fishtype;

	# bless it into the package (store it)
	return bless $self;
}	

sub sayname {
	# Retrieve the self variable
	my($self)=@_;
	# Extract the fishtype variable
	my $name="$self->{'fishtype'}";


	print "My name ".$name." \n";
}

# Make sure it returns true at the end of the day
1;
