G'day thurinus,
Welcome to the Monastery.
As already indicated, it's likely you have line terminators not matching the '$'. You may have more success using '\R', the generic newline. See perlrebackslash: \R and note you'll need at least Perl v5.10 to use this.
Here's a quick-and-dirty example to compare '$' with '\R':
$ perl -E ' my @x = ( "A\n", "B.\n", "C\r", "D.\r", "E\r\n", "F.\r\n", "G\f", "H.\f" ); say q{*** With $ ***}; say "|$_|" for grep /\.$/, @x; say q{*** With \R ***}; say "|$_|" for grep /\.\R/, @x; ' *** With $ *** |B. | *** With \R *** |B. | |D. |F. | |H. |
In case you didn't know, the '\f' is a form-feed.
— Ken
In reply to Re: Perl regex txt file new line (not recognised?)
by kcott
in thread Perl regex txt file new line (not recognised?)
by thurinus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |