June 2001 Making a Module Back Slide 42 Forward

Method Call

sub method_name
{
	my $self = shift;
	#rest of the function here
}

$object->method_name (@Parameters);

&method_name ($object, @Parameters);

  • First thing done must be to take the $self off of the @_
  • $self is a pointer to the blessed hash
  • Then it is a normal function again
  • Should not EXPORT methods as there is a way to reach them already


Copyright © 2001 R. Geoffrey Avery Back Contents Forward