BÁRTHÁZI András skribis 2005-06-26 19:35 (+0200):
> method fun1() { fun2(); }
> method fun2() { say "fun2!"; }
> *** No compatible subroutine found: "&fun2"
fun2 is a method, not a sub. You need method syntax to call it:
./fun2;
> class MyMethod { method fun1() { fun2(); } sub fun2() { say "fun2!"; }
> } class Child is MyMethod { }
> Child.fun1();
> Sounds good. It seems to me, that I can call fun2() from inside
> MyMethod, from everywhere. OK, Child is MyMethod, so can I do it there
> too? No. :(
IIRC, that's what submethods are for. Submethods aren't inherited. It is
unclear to me whether subs are.
Two requests:
1. Please indent code and don't use cutting lines.
2. Please use visually more different names, fun1 and fun2 look a lot
alike. Consider foo and bar.
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http://convolution.nl/gajigu_juerd_n.html