yes my bad, i actually figured that problem out myself.
It runs fine now, however i don't think it's doing what it is supposed to on the bottom half codes
As you know, i'm trying to compare each row of first column, and if it doesn't equal i want it to count the each unmatched rows and print it out the number of counts.
However, i think my code is not comparing each row but the reference to the array, so it gives me unmatched counts although my files have no unmacthed rows.
So my question is, why isn't comparing each row individually, and how can i fix it to make it work ?
Thanks,
my $unmatched = 0 ;
my @names;
my $filecount1 =$filecount-1;
for (my$chr =1; $chr <= $filecount1; $chr++){
if ($row[0] ne $row[$chr]) {
$names[$unmatched] =$filename[$chr];
$unmatched++;
}
print "Total # of files compared: $filecount \n";
print "Total # of files unmatched: $unmatched\n";
print "name of the files unmatched : @names \n " ;
}
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.