hi people...
Back again to seek you wisdom and guidance on a particularly weird and frustrating problem... SO here goes...
I'm trying to compare the elements of an array with each cell of an excel sheet and print the one that matches... i know this looks pretty simple .... But i've been facing a weird problem:
when i print the array and the cell individually , i can easily make out the similar values,.. but when i compare the values,the code doesnt seem to realize it .. it jus treats it as a different element(eg it treats 1 and 1 as diff). I've been using strict , warnings and diagnostics.. but none seem to find any error...
i've tested the rest of the code.. the trouble some part is given below:
foreach $ray(@cellr)
{
if($ray eq $worksheet->{Cells}[$row][1]->{Val} )
{
print "$ray :yes\n";
}
else
{
next;
}
}
Easy enough right ..??? Now there is a another way(comparatively difficult and inefficient ) by means of pattern match but i dont want to go there.. Help please..!!
i dnt think its a problem with the files coz i am able to read and print the values perfectly.. its the comparison (for some reason) thats starting to bug me nw ...Any ideas what can cause such a problems ??
THanks.!!
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.