Problems? Is your data what you think it is? | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
You may be looking for a Perl solution, so I'll give you feedback. You may be learning Perl, or may not be running on a Unix platform. First a comment about lexical variables and use strict;. Get yourself into the habit of declaring your variables with my, and only declaring them in the narrowest scope that you need them. A Super search on "use strict" will give you many answers that explain why this is a good idea. Secondly, your test for evenness of the line count is the wrong way to do things. Each time you get an odd number of singular lines, it will throw out the evenness check. Here's my stab:
Note that you don't deal with, or say whay you want to happen when you get three or more identical lines in the input. -- In reply to Re: Read file line by line and check equal lines
by rinceWind
|
|