pseudocode example: # this is the (infinite) main loop, which takes a line of # keyboard input and processes it, until the program is # killed while (<>) { # call subs here if (foo) { &a(); next; } elsif (bar) { &b(); next; } else { &c; } } sub a { # do stuff if (divide by zero error) &myerror(message); &c(); # do more stuff return value; } sub b { # do a lot of stuff if (format is wrong) &myerror(message); # do more stuff return hash; } sub c { # do stuff if (type mismatch) &myerror(message); &b(); return list; } sub myerror { # print error message # and now I want to go straight back to the main # loop, no matter how many levels of subroutines # deep this &myerror call was, as if the program # were just starting (with the single exception # that I want to keep all the program's # global variables intact) }