in reply to Subroutines with Parameters
G'day MoniqueLT,
You've received good advice on writing a subroutine; however, I noticed you actually wrote: "... I would like to make a method ...".
If you want to code:
$object->method_name($param1, $param2, $param3);
Then your subroutine definition will typically look more like this:
sub method_name { my ($self, $param1, $param2, $param3) = @_; ... }
See "perlootut - Object-Oriented Programming in Perl Tutorial" for a general discussion and the Methods section for specifics.
-- Ken
|
|---|