Login
You're viewing the techdon.dev public feed.

Replies

  • Sep 17, 2025, 1:19 PM

    @barubary @phl @traecer

    I was less precise than I could have been, I suppose. =~ is what *causes* the regex matching to happen. m/PATTERN/ on it's own does not. =~ is also used for both transliterations and substitutions.

    💬 1🔄 0⭐ 0
  • Sep 17, 2025, 1:39 PM

    @splatt9990 @phl @traecer The problem I have with

    m/PATTERN/ doesn't actually do matching, it's just a short hand that expands (in certain contexts) to $_ =~ m/PATTERN/

    is that m/PATTERN/ expands to $_ =~ m/PATTERN/ in literally every context except for the specific case of split's first argument (or if it's already the right-hand operand of a =~, of course).

    (Also, it's not what the implementation actually does. m/.../ on its own produces a "match" op without an implicitly added reference to $_ anywhere. That's why e.g. B::Deparse produces different output for /foo/ vs $_ =~ /foo/.)

    💬 1🔄 0⭐ 1