Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Hidden Newline in Result

by dave_the_m (Monsignor)
on Mar 05, 2017 at 20:00 UTC ( #1183713=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1183713]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2019-07-17 13:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?