Fwd: $/ not always set after a regex match?

[email protected] (William Michels via perl6-users)
Newsgroups perl.perl6.users
Message-ID <CAA99HCzzVhKg47pfoEKS20gS5gGiXNcvKfkLVTzipJt6Y9sVnA@mail.gmail.com>
RESENDING: The code examples below should read `<?before ...>` in all
cases, not `<before ...>`, although either works (erroneously?).

-------------------

Interested in answering the question:

WHICH CODE EXAMPLE IS THE PRETTIEST?

Vote for your favorite (or post your own):

[#] > #REPL (line numbers altered to differentiate)
Nil
[0] > $_ = 'gracefully'
gracefully
[1a] > put "The root of $_ is $/." if / .+ <?before ly> /;
The root of gracefully is graceful.
[1b] > put "The root of $_ is $<>." if / .+ <?before ly> /;
The root of gracefully is graceful.
[1c] > print "The root of $_ is " andthen put $/ ~ '.' if / .+ <?before ly>
/;
The root of gracefully is graceful.
[1d] > print "The root of $_ is " andthen put $<> ~ '.' if / .+ <?before
ly> /;
The root of gracefully is graceful.
[1] >
[2a] > put "Or is the root of $_ $/?" if / .+ <?before full> /;
Or is the root of gracefully grace?
[2b] > put "Or is the root of $_ $<>?" if / .+ <?before full> /;
Or is the root of gracefully grace?
[2c] > print "Or is the root of $_ " andthen put $/ ~ '?' if / .+ <?before
full> /;
Or is the root of gracefully grace?
[2d] > print "Or is the root of $_ " andthen put $<> ~ '?' if / .+ <?before
full> /;
Or is the root of gracefully grace?
[#] >
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.