SPUG: overriding a module's normal behavior
andrew at sweger.net
Tue Mar 1 14:39:44 PST 2005
On Tue, 1 Mar 2005, Jon Burdge wrote:
> So, in the interest of just getting things done and not messing with the
> standard libraries, I loaded Net::SSH::Perl::Auth::KeyboardInt, then
> defined *Net::SSH::Perl::Auth::KeyboardInt::authenticate to point to a
> subroutine I provide.
If a module is not an object interface, then what you've done above is the
most direct approach (short of recreating the entire API in a new module).
One downside is you will not have access to any lexically scoped
structures within the module (i.e., "global" [sic] variables). But if you
need that kind of access, tapping in this way would be short-sighted.
Another downside would be circumventing the keyboard-interactive feature
of SSH. But that's a security issue you'll have to weigh.
Andrew B. Sweger -- The great thing about multitasking is that several
things can go wrong at once.
More information about the spug-list