in reply to Nested OR as a control structure
I'm not exactly sure where it was failing before, but the complicated blocks to force critical and non-critical areas must have had me seeing things, from here I can work the critical/non-critical sections back in.#!/usr/bin/perl dofistcritical() or dobackupcritical() or dofailed(); sub dofistcritical {if (int rand 5) {print "hooray it worked first time!\n"} else {return 0}} sub dobackupcritical {if (int rand 5) {print "First time failed but luckily the backup worked...phew\n"} else {return 0}} sub dofailed {if (int rand 5) {print "Main failed. Backup Failed. You have 3 minutes to reach a +safe distance\n"} else {return 0}}
|
|---|