Skip to content

Instantly share code, notes, and snippets.

@hoelzro
Created July 8, 2012 15:01
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 hoelzro/3071300 to your computer and use it in GitHub Desktop.
Save hoelzro/3071300 to your computer and use it in GitHub Desktop.
use v6;
my $depth = 0;
sub recurse(Int $levels) {
temp $depth;
$depth++;
if $levels > 0 {
recurse($levels - 1);
}
};
say "before: $depth";
recurse(0);
say "after: $depth";
say "before: $depth";
recurse(10);
say "after: $depth";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment