in reply to Re: You cannot pass args when calling inner() in Moose?
in thread You cannot pass args when calling inner() in Moose?

No, because the superclass method does things before and after the loop. The only thing that the GUI aspect does is update a progress bar during a loop. I settled on simply having an if-then within updateprogress
sub updateprogress { my ($self) = @_; return unless $self->progressbar; my @frac = ($self->recordi, $self->recordcount); my $frac = frac(@frac); $self->progressbar->set_fraction($frac->num); $self->progressbar->set_text( sprintf '%d / %d', @frac); use Gtk2; while (Gtk2->events_pending) { Gtk2->main_iteration; } Gtk2::Gdk->flush; }
sub manager { my ($Operation) = @_; my @row = $Operation->getnew; $Operation->log->debug( 'getnew rows:' . scalar(@row) ); $Operation->recordi(0); for my $row (@row) { $Operation->recordi( $Operation->recordi + 1 ); $Operation->log->debug( ' --- data --- ' . Dumper($row) ); $Operation->data($row); $Operation->process; $Operation->updateprogress; } }




The mantra of every experienced web application developer is the same: thou shalt separate business logic from display. Ironically, almost all template engines allow violation of this separation principle, which is the very impetus for HTML template engine development.

-- Terence Parr, "Enforcing Strict Model View Separation in Template Engines"