tryfirstchoice() or trysecondchoice() or trynextchoice or .... trylastchoice(); #### #!/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; } Running this produces: # perl or.pl tryfirstchoice trysecondchoice #