In dotall mode, the expression . matches any character, including a line terminator. By default this expression does not match line terminators.
(The s is a mnemonic for "single-line" mode, which is what this is called in Perl.)