Indeed. I conflated two similar techniques: getting a list of matches from /(...)/g and getting a list of matches from /(...)(...)(...)/. You don't get a list of matches from /(...)*/ (nor from /(...)*/g).
What I should have written was:
my @chunks = $description =~ /\G((?:[^\n]*\n){14}|.+)/gs;
(tested even; works even)
Update: Changed last * to + to eliminate extra empty string in result that I just noticed which is due to "quirk" in Perl regex processing (something I think we should just 'fix', but that is a story for another node, one I've written at least once already).
|