Q&A > object-oriented programming
Description:
Would it be possible to override a method this way?or \&GD::Graph::axestype::create_x_label = sub {sub GD::Graph::axestype::create_x_label {
I know these doesnt work because I've tried, is there another way like this?
-ryan
Answer: overriding a methods. contributed by merlyn The first one works fine, provided you understand that you're compiling code which has to be compiled after the original method is compiled. So, it's fine after a use that pulls in the other module. You'll probably get a "redefining ___" warning though. The typeglob assignment has also worked for me in the past. |
Answer: overriding a methods. contributed by belg4mit You could typeglob...
|
Please (register and) log in if you wish to add an answer
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |