You don't have to, but when building "Object Oriented" modules, use a constuctor:
And chromatic is spot on ... you are not removing the package name from your method argument list.use strict; use warnings; my $auth = Mymodules::Auth->new(); $auth->auth('foo', 'bar'); package Mymodules::Auth; sub new { my $class = shift; my $self = {}; return bless $self, $class; } sub auth { my ($self,$user,$pass); ... }
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
In reply to Re: Building modules, my mental block
by jeffa
in thread Building modules, my mental block
by neilwatson
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |