http://www.perlmonks.org?node_id=1183713


in reply to Hidden Newline in Result

It's not directly related to your issue, but note that your code is needlessly over-complex, and could be simplified enormously. Every case code block is virtually identical apart from (AFAIKT) differences in the constants for the comparisons and minor differences in what is output. This could be handled as a simple hash of hashes of arrays. In outline:
my %actions = ( '000005' => { '1205' => [ 58, 62, ... ], '1210' => [ 56, 60, ... ], ... }, '000015' => { '1215' => [ 28, 30, ... ], '1230' => [ 26, 28, ... ], ... }, ); ... my $action = $actions[$field[11]; if ($action) { my $action2 = $action->{$timestamp}; if ($action2) { my ($maxarray, $field_ix, $whatever_else) = @$action2; if ($arraysize > $maxarray and $field[$field_ix] eq '') { .... } else { .... } } else { .... } } else { .... }
In any case, don't rely on Switch: it's buggy and was removed from the perl core 6 years ago.

Dave.