The m flag on regex gets treated as the start of a new regex. For example; my @lines = split(/^/m, $expr); gets parsed as a /^/ regex, followed by a m, ..... regex (and the next comma is many lines away!)