J
J Krugman
I have this class from CPAN (let's call it, creatively enough, Foo)
that suits me fine in almost every respect, except for one workhorse
method (say, bar) that I think could be significantly enhanced.
One possibility would be to create a subclass MyFoo of Foo just
for the purpose of overriding bar. Alternatively, I could have a
file FooSupplement.pm, in which I do something like
use strict;
use warnings;
package Foo;
{
no warnings 'redefine';
sub bar {
# raise the bar to perfection
}
}
1;
Then, instead of using some subclass MyFoo, I use good ol' Foo
followed by "use FooSupplement".
I *suppose* (please correct me if I'm wrong) that this is yet
another one of those choices that boils down to personal preference,
but I'd love to take a very informal poll on what programmers here
would typically prefer to do in such a situation.
TIA,
jill
that suits me fine in almost every respect, except for one workhorse
method (say, bar) that I think could be significantly enhanced.
One possibility would be to create a subclass MyFoo of Foo just
for the purpose of overriding bar. Alternatively, I could have a
file FooSupplement.pm, in which I do something like
use strict;
use warnings;
package Foo;
{
no warnings 'redefine';
sub bar {
# raise the bar to perfection
}
}
1;
Then, instead of using some subclass MyFoo, I use good ol' Foo
followed by "use FooSupplement".
I *suppose* (please correct me if I'm wrong) that this is yet
another one of those choices that boils down to personal preference,
but I'd love to take a very informal poll on what programmers here
would typically prefer to do in such a situation.
TIA,
jill