http://qs321.pair.com?node_id=442869


in reply to Re^3: Stupid mistakes I repeatedly make
in thread Stupid mistakes I repeatedly make

I've use this in my code before:
#actual data came over the network with inconstant line ends. my $text = "some\r\nmulti-line\ntext"; my $line_count = $text =~ s/\r?\n/\n/g;
There were cenrtanly a dozen other ways to get the line count, but for what was being done this was the most strait forward, without doing double work.