Hi All

The piece of code below always render "Test" indicating to me that the
$mytest variable is never touched in the anonymous sub in the then or the
catch. I cant understand what i do wrong ?

sub search {
    my $self = shift;

    my $mytest = 'Test';
    $self->stockitems->search_p('*')->then(sub {
      my $results = shift;

      $mytest = 'Test Test Test';
    })->catch (sub {
      my $err = shift;

      $mytest = 'ERROR';
    })->wait;;

    $self->render(template => 'stockitems/search',  mytest => $mytest);
}

Any feedback or ideas are much apreciated

Thank you in advance !


Best Regards
Jan

-- 
Titles mean nothing.  The one with a servant's heart is the leader.

Please consider the environment before you print this email.

All incoming and outgoing emails and any attachments are subjected to a
virus scanner and are believed to be free of any virus, or any other defect
which might affect any computer or IT system into which they are received
and opened. Therefore, it is the responsibility of the recipient to ensure
that they are virus free and no responsibility is accepted by Jan Eskilsson
 for any loss or damage arising in any way from receipt or use thereof.

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to