Skip to content

Commit

Permalink
Clear up confusion on temp
Browse files Browse the repository at this point in the history
Fixes #1085
  • Loading branch information
coke committed Dec 28, 2016
1 parent 0904dc8 commit 7b663ba
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions doc/Language/operators.pod6
Expand Up @@ -1173,9 +1173,15 @@ sub prefix:<temp>(Mu $a is rw)
=end code
"temporizes" the variable passed as the argument, which means it is reset
to its old value on scope exit. (This is similar to the
L<local|http://perldoc.perl.org/functions/local.html> operator in Perl 5,
except that C<temp> does not reset the value).
to its old value on scope exit. For example:
my $a = "three";
say $a; # three
{
temp $a = "four";
say $a; # four
}
say $a; # three
=head2 prefix C«let»
Expand Down

0 comments on commit 7b663ba

Please sign in to comment.