reaper9187 has asked for the wisdom of the Perl Monks concerning the following question:
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:
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:
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.!!foreach $ray(@cellr) { if($ray eq $worksheet->{Cells}[$row][1]->{Val} ) { print "$ray :yes\n"; } else { next; } }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Weird excel parsing problem
by BrowserUk (Patriarch) on Nov 05, 2012 at 18:54 UTC | |
by reaper9187 (Scribe) on Nov 05, 2012 at 19:04 UTC | |
Re: Weird excel parsing problem
by Kenosis (Priest) on Nov 05, 2012 at 18:45 UTC | |
by Tanktalus (Canon) on Nov 05, 2012 at 18:52 UTC | |
by afoken (Chancellor) on Nov 06, 2012 at 05:43 UTC | |
by Tanktalus (Canon) on Nov 06, 2012 at 13:59 UTC | |
by reaper9187 (Scribe) on Nov 05, 2012 at 18:47 UTC | |
by Kenosis (Priest) on Nov 05, 2012 at 18:52 UTC |
Back to
Seekers of Perl Wisdom