Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Column by Column Comparison

by moritz (Cardinal)
on Mar 31, 2013 at 13:53 UTC ( #1026357=note: print w/ replies, xml ) Need Help??


in reply to Column by Column Comparison

You should really begin your programs with

use strict; use warnings;

It catches several potential errors in your script:

Scalar value @elements[0] better written as $elements[0] at foo.pl lin +e 13. Scalar value @filtered[$count] better written as $filtered[$count] at +foo.pl line 21. Scalar value @elements[$count] better written as $elements[$count] at +foo.pl line 21. Scalar value @filtered[$count] better written as $filtered[$count] at +foo.pl line 22. Scalar value @elements[$count] better written as $elements[$count] at +foo.pl line 22. Bareword "easy" not allowed while "strict subs" in use at foo.pl line +15. foo.pl had compilation errors.

(The latter is just an artifact from you not using a comment when you should).

Second you should indent your code consistently, indenting the contents of each block by a fix amount more than the code outside the block.

And third, it would be much easier to help you if your provided some example input data so that we can run your code, and then tell us what you get, and what you expected instead.


Comment on Re: Column by Column Comparison
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2014-12-21 17:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (106 votes), past polls