I'm writing a script for work that navigates users through a complex
decision-making tree, where decisions are made based on some fairly in-depth
processing of data entered by the user.  The script runs really well, does
exactly what we need it to do.  I'm having some trouble with the humans
using it making data entry errors.  A lot of these are caught by code I've
included to prompt the user to re-enter data when what they've entered
doesn't make sense (e.g., patient weight exceeding 250 kg., diastolic blood
pressure values that include non-numeric characters).  Some errors aren't
caught by the script because they're not obvious, and it's not being noticed
by a human until several steps later.

What I want to do is be able to allow the user to return to a prior step,
but I'm having trouble figuring out how to make that work using last or
next, or a control loop.  I could pry make clever use of control loops in a
smaller script, but we're talking nearly 100 decisions in the tree.  I never
bothered to learn how to use goto because it's deprecated (or on it's way?),
but it seems like this would be a good place to use it.  At the same time, I
understand that use of goto is akin to sleeping with your sister among most
programmers in the Perl programming community.

I'd like to be able to share some code here, but the people who sign my
checks have asked me not to.

Can anyone point me in the right direction?  Thanks for any help.

OC.

Reply via email to