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.
|
|---|