in reply to Splicing the next element in an array

Your @finalArray contains just one element. Also, '\n' and "\n" are not the same.
use 5.010; use strict; use warnings; my @infoArray = ( 1, 2, 3, 4, 5, "\n", 6, 7, 8, 9, 10, "\n" ); my @line; for (@infoArray) { if ( $_ eq "\n" ) { say join "\t", @line; @line = (); } else { push @line, $_; } }

Replies are listed 'Best First'.
Re^2: Splicing the next element in an array
by Anonymous Monk on Apr 08, 2014 at 17:07 UTC
    This made much more sense, and worked on my input file. Thank you.