Hi Todd, yes in a sense "$/" is related to "$_" in that they're both
variables that get filled with values behind the scenes by Raku/Perl6.
You already know that "$_" is the general default 'topic' variable
(same as in Perl 5, see Ref#1 below).

>From Ref#2 below: " $/ is the match variable. It stores the result of
the last Regex match and so usually contains objects of type Match."
Apparently "$/" in Raku/Perl6 has replaced a series of variables that
were used in Perl5, including  "$`", "$&", and "$'" which "are gone
from Raku" (Ref#3 below):

1. https://docs.raku.org/language/5to6-perlvar#$ARG,_$_
2. https://docs.raku.org/syntax/$$SOLIDUS
3. 
https://docs.raku.org/language/5to6-perlvar#Variables_related_to_regular_expressions

HTH, Bill.


On Fri, Dec 6, 2019 at 9:28 PM ToddAndMargo via perl6-users
<perl6-us...@perl.org> wrote:
>
> On 2019-12-06 20:33, William Michels via perl6-users wrote:
> > say $/;
>
> First I have seen of `$/`.  Is it any relation to `$_`?

Reply via email to