Skip to content

Instantly share code, notes, and snippets.

@mlschroe
Created October 14, 2011 09:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mlschroe/1286654 to your computer and use it in GitHub Desktop.
Save mlschroe/1286654 to your computer and use it in GitHub Desktop.
my $r = '';
sub foo {
UNDO { $r ~= "U1"}
KEEP { $r ~= "R1"}
CATCH {
if (1) {
UNDO { $r ~= "U3"}
KEEP { $r ~= "R3"}
return True;
}
}
if (1) {
UNDO { $r ~= "U2"}
KEEP { $r ~= "R2"}
die("foo");
}
}
foo();
say $r;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment