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

2023-01-02 Thread Vadim Belman
There are little known operators `andthen`, `orelse`, `notandthen` (I always forget about the latter one too). What you are looking for would be: given $s { m/ $=\w+ / andthen ..say } Or, if you want a named variable: given ("aaa") { (my $m = m/$=\w+/) andthen $m..say } Best regards, Vadim

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

2023-01-02 Thread yary
I like statement modifiers, though not so much using side-effect variables set by a postfix modifier, I'd like to see the side effect before seeing the variable it sets. Something like / .+ / && put "The root of $_ is $/."; though the discussion is about not setting $/ in the caller's context