in reply to Re^4: Noob OO Question
in thread Noob OO Question

Typing it like this doesn't work for me.
$self->{test_b}->()
It gives me this output.
Not a CODE reference at Hi.pm

Replies are listed 'Best First'.
Re^6: Noob OO Question
by ikegami (Patriarch) on Jun 08, 2010 at 04:59 UTC
    Better yet, change
    my $test = new Hi( test_a => 'hello', test_b => \sub{ return 1 }, test_c => \sub{ get_me( $get_a, $get_b ) }, );
    to
    my $test = new Hi( test_a => 'hello', test_b => sub{ return 1 }, test_c => sub{ get_me( $get_a, $get_b ) }, );

    There's no reason for the extra level of indirect.

Re^6: Noob OO Question
by bluescreen (Friar) on Jun 08, 2010 at 00:21 UTC