Every subroutine can be used from the object and externally. There are no private methods/subroutines in Perl.
There is one thing to remember - you cannot (or rather, should not try to) make a subroutine that can act as both, a method and a plain subroutine. No good comes of that.
package My::Class; sub my_method { my ($self,@args) = @_; print "@args\n"; }; sub other_method { my ($self,@args) = @_; $self->my_method('hello'); }; package main; My::Class->my_method('world');
In reply to Re: perl module subroutine
by Corion
in thread perl module subroutine
by sudeeps
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |