in reply to Altering Package Subs and Running In To Problems
So my end cgi scripts only 'use' the my::db module, and my::db->new returns a Sybase::DBlib object, but when you call $dbh->myVersionOfAnExistingMethod() you get my version instead of the built in version.#! start of my/db.pm package my::db; use Sybase::DBlib; sub new { return Sybase::DBlib->new(@_); } { package Sybase::DBlib; sub my_version_of_an_existing_method { # foo } }
You can also add methods to the namespace that way as well.
Note that this is less clean if you are using a non-OO module, but by 'use'ing your module after the original one, the same effect will be had.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Altering Package Subs and Running In To Problems
by mpeppler (Vicar) on Nov 11, 2004 at 19:49 UTC | |
by aufflick (Deacon) on Nov 12, 2004 at 13:39 UTC | |
by mpeppler (Vicar) on Nov 12, 2004 at 13:44 UTC | |
by aufflick (Deacon) on Jan 11, 2005 at 00:19 UTC |