in reply to Re: Noob OO Question
in thread Noob OO Question
When you instantiated the Hi package you passed references to some subroutines, in method_b for example you return the reference back to the caller, you are not executing the method
Consider this
my $sub_ref = \sub { my $who = shift; print "hello $who\n"; }; #In order to execute need to deref by prefixing with $ $$sub_ref->('dude');
coderefs are tricky so try to keep your examples simple until you get the grasp on it
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Noob OO Question
by Anonymous Monk on Jun 07, 2010 at 23:52 UTC | |
by JavaFan (Canon) on Jun 08, 2010 at 00:01 UTC | |
by Anonymous Monk on Jun 08, 2010 at 00:12 UTC | |
by ikegami (Patriarch) on Jun 08, 2010 at 04:59 UTC | |
by bluescreen (Friar) on Jun 08, 2010 at 00:21 UTC |