zaebst has asked for the wisdom of the Perl Monks concerning the following question:
package WebUtil; sub Gen_HTML { my $self = shift; # # Do stuff to make html $self->{$HTML} .= qq( html content stuff ); return($self->{$HTML}); } sub run_pjx { my $self= shift; my $pjx = new CGI::Ajax( 'exported_func' => sub { my $in = shift; return("Changed +Main $in\n"); }, 'skip_header' => 1 ); my $ref_Gen_HTML = sub { $self->Gen_HTML() }; print $pjx->build_html( $self->{$WU_CGI} , &$ref_Gen_HTML ); #note should be: build_html( $cgi_object, \&callback_Function ); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Object Oriented Callback
by ikegami (Patriarch) on Dec 17, 2008 at 05:31 UTC | |
|
Re: Object Oriented Callback
by kennethk (Abbot) on Dec 17, 2008 at 05:52 UTC | |
by zaebst (Initiate) on Dec 17, 2008 at 06:19 UTC |