[Mpls-pm] Dumb Question...Module Method - Dual Name

Gary Vollink gary.vollink at gmail.com
Thu Oct 20 15:13:41 PDT 2005


Ken,

> > $mydb = corvu::Db::new();

I did catch this one a bit ago.

> And if you want to preserve the old
> corvuDbSelect() method, you should implement it like so, because
> Select() is now a method, not a function:
>
>    sub corvuDbSelect {
>      __PACKAGE__->new()->Select( @_ );
>    }
>

Preserve is pretty much right.  I have a lot of programs that use
these functions (about 11 functions copied, verbatim, into about 40
CGI scripts).  The "easy" way is to be able to import the functions
through use ... qw/func1 func2/.  Obviously, going forward, it would
be prudent for me to use an OO method (thus the badly worded
questions).

__PACKAGE__?  If I need specific, should I shift $self, and use it that way?
And, why call via new()?
Any further discussion as to what will go wrong with the way it's
occuring now (I'm fully confident that it will eventually go wrong). 
Again, willing to read.

As an asside, In it's current state new() will destroy my init vars (I
can change that, probably would bite me later anyway)...(but I'm not
sure why).

>   -Ken

Yeah, I'm really new at the whole module experience, and I'm probably
biting off a lot (certainly, so far it would have been simpler to copy
my changes manually into my 40 CGI scripts - but next time...easy). 
So, at the risk of seeming like an idiot (you don't have to agree so
quickly), I ask a whole lot of questions to anyone willing to answer.

Thank you,
Gary Allen


More information about the Mpls-pm mailing list