Topic variable: Difference between revisions

m
→‎{{header|Raku}}: Fix link: Perl 6 --> Raku
(Rename Perl 6 -> Raku, alphabetize, minor clean-up)
m (→‎{{header|Raku}}: Fix link: Perl 6 --> Raku)
Line 539:
(formerly Perl 6)
 
As in previous versions of Perl, in Perl6Raku the topic variable is $_. In addition to a direct affectation, it can also be set with the 'given' keyword. A method can be called from it with an implicit call:
 
<lang perl6>given 3 {
.say for $_**2, .sqrt;
}</lang>
The scope of the <tt>$_</tt> variable is always lexical in Perl 6Raku, though a function can access its caller's topic if it asks for it specially via <tt>CALLER::<$_></tt>.
 
=={{header|REXX}}==
2,392

edits