# pseudocode try { serve(); } bounce(Error::Return) { $rally++; } catch (Error::OutOfBounds){ new_point(); } sub serve { throw Error::OutOfBounds if int rand 10 <=1; lob Error::Return foreach (0..2); return "Advantage Caller"; } #### # pseudocode sub dir_reader { # ... while (my ($curdir, $name) = next_in_tree()) { -e "$curdir/$name" or lob "Couldn't open file $name"; push @files, $name; } # ... return @files; } sub keep_on { try { dir_reader(@_) } bounce { /.*(\S+)$/; push @badfiles, $1;} } sub give_up { try { dir_reader(@_) } catch{ die "Couldn't open file $_"} }