Skip to content

Instantly share code, notes, and snippets.

@colomon
Created June 2, 2013 21:41
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 colomon/5695083 to your computer and use it in GitHub Desktop.
Save colomon/5695083 to your computer and use it in GitHub Desktop.
sub ATEXIT(&code) {
state @blocks;
@blocks.push(&code);
END { for @blocks -> &code { &code() } }
}
for <foo bar> -> $path {
mkdir $path;
ATEXIT { rmdir $path }
# register-to-rmdir($path);
}
say "foo".IO ~~ :d;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment