|Welcome to the Monastery|
Split string after 14 Line Feeds?by johnfl68 (Sexton)
|on Dec 03, 2012 at 23:05 UTC||Need Help??|
johnfl68 has asked for the
wisdom of the Perl Monks concerning the following question:
I have sets of messages in strings, that are anywhere from 8 lines (LF at the end of each line) to about 50 lines.
I need to split them into chunks of 14 lines.
I know I can split the individual lines into an array using the line feed "\n" to do this, then scalar the array to find out how many lines, and then build back into a string of 14 for each block.@descriptarray = split("\n",$description);
Is there a shorter way to do the split at every 14th line feed?
Thanks as always!