then why not just do so?tryfirstchoice() or trysecondchoice() or trynextchoice or .... trylast +choice();
#!/use/bin/perl -lw tryfirstchoice() or trysecondchoice() or trylastchoice(); sub tryfirstchoice { print "tryfirstchoice"; return; } sub trysecondchoice { print "trysecondchoice"; return 1; } sub trylastchoice { print "trylastchoice"; return 1; } <code> Running this produces: <code> # perl or.pl tryfirstchoice trysecondchoice #
--Bob Niederman, http://bob-n.com
All code given here is UNTESTED unless otherwise stated.
In reply to Re: Nested OR as a control structure
by bobn
in thread Nested OR as a control structure
by andyf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |