Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Hidden Newline in Result

by dave_the_m (Monsignor)
on Mar 05, 2017 at 20:00 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1183713]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-19 21:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found