in reply to OO modules

Perl assigns no special meaning to new.

bless associates a hash* with a class, allowing $o->method to work.

package Class; sub new { # Or any other name you want. my ($class) = @_; my $self = bless({}, $class); # $self->{...} = ...; return $self; } sub method { my ($self) = @_; #... } my $o = Class->new(); $o->method();

Replies are listed 'Best First'.
Re^2: OO modules
by BernieC (Pilgrim) on Dec 28, 2020 at 19:35 UTC
    Thanks for the help -- it comes back to me now ... :) I mentioned "local library" because I have a directory in which I do all of my perl hacking and I'm going to put the .pm file in along with all the .pl files. I'm not going to "install" it in the actual Perl libraries hierarchy. I think I've got it now. Thanks for all the help

      hmmm? Where files are located has no bearing on how to create an object.