<div dir="ltr">Hello Gert,<div><br></div><div>Thank you very much for the reply. I will try to make use of it.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El mié, 17 feb 2021 a las 2:48, Gert van Oss (<<a href="mailto:gertvanoss@me.com">gertvanoss@me.com</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;">Something like this?<div>You can get lost in the ‘IF, AND, OR’ stuff but it could be a start.</div><div>Gert</div><div><br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div>package App;</div></div><div><div>use Dancer2;</div></div><div><div>use Data::Dumper;</div></div><div><div><br></div></div><div><div>get '/' => sub {</div></div><div><div>    return <<'HTML';</div></div><div><div><form action="/q-1" method="GET"></div></div><div><div><p>Did you ever drink coffee?</p></div></div><div><div><input type="text" name="coffee"></div></div><div><div><p>What is your age?</p></div></div><div><div><input type="text" name="age"></div></div><div><div><input type="submit"></div></div><div><div></form></div></div><div><div>HTML</div></div><div><div>};</div></div><div><div><br></div></div><div><div>get '/q-1' => sub {</div></div><div><div>    my %FIELD;</div></div><div><div>    my @field_names = qw(coffee age);</div></div><div><div>    foreach my $field_name (@field_names) {</div></div><div><div>        if ( defined param("$field_name") ) {</div></div><div><div>            $FIELD{$field_name} = param("$field_name");</div></div><div><div>        }</div></div><div><div>    }</div></div><div><div><br></div></div><div><div>    print Dumper \%FIELD;</div></div><div><div>    if ( $FIELD{'coffee'} eq "yes" && $FIELD{'age'} >= 16 ) {</div></div><div><div><br></div></div><div><div>        # redirect '/more-questions';</div></div><div><div>        redirect '/bike';</div></div><div><div>    }</div></div><div><div>    else {</div></div><div><div>        redirect '/other-questions';</div></div><div><div>    }</div></div><div><div>    if ( $FIELD{'age'} > 16 ) {</div></div><div><div>        redirect '/bike';</div></div><div><div>    }</div></div><div><div>};</div></div><div><div><br></div></div><div><div>get '/more-questions' => sub {</div></div><div><div>    return "More questions";</div></div><div><div>};</div></div><div><div>get '/other-questions' => sub {</div></div><div><div>    return "Other questions";</div></div><div><div>};</div></div><div><div>get '/bike' => sub {</div></div><div><div>    return "In my country you may ride a scooter though it is better to bike!";</div></div><div><div>};</div></div><div><div>App->to_app;</div></div></blockquote><div><br></div><div><br></div><div><br><div><br><blockquote type="cite"><div>On 16 Feb 2021, at 00:26, Richard Reina <<a href="mailto:gatorreina@gmail.com" target="_blank">gatorreina@gmail.com</a>> wrote:</div><br><div><div dir="ltr">I have a friend who needs me to develop a page which is a long survey, There is some skip logic needed, for example, if users birthday is before x date skip to question 5, if answer to question 12 is 'no' skip to question 16, but nothing too complicated. I nevertheless am struggling with how to design such a route and was wondering if anyone perhaps knew of any similar examples.<div><br></div><div>Rciahrd</div></div>
_______________________________________________<br>dancer-users mailing list<br><a href="mailto:dancer-users@lists.preshweb.co.uk" target="_blank">dancer-users@lists.preshweb.co.uk</a><br><a href="https://lists.preshweb.co.uk/mailman/listinfo/dancer-users" target="_blank">https://lists.preshweb.co.uk/mailman/listinfo/dancer-users</a><br></div></blockquote></div><br></div></div>_______________________________________________<br>
dancer-users mailing list<br>
<a href="mailto:dancer-users@lists.preshweb.co.uk" target="_blank">dancer-users@lists.preshweb.co.uk</a><br>
<a href="https://lists.preshweb.co.uk/mailman/listinfo/dancer-users" rel="noreferrer" target="_blank">https://lists.preshweb.co.uk/mailman/listinfo/dancer-users</a><br>
</blockquote></div>