in reply to Parsing a date from comma-delimited file
If you really are comparing a string ... then use the string comparison operator:
You additionally should place a temporary "debug check" to see what is really going on:if ($lineData[18] eq $date) {
I'll let someone else comment about about $lineData[18] itself.warn "comparing $lineData[18] to $date\n"; if ($lineData[18] eq $date) {
UPDATE: Here is a little test for you:
I'll bet you didn't turn warnings on, did you. :)no warnings; print '12/Mar/2004' eq '12/Mar/2004' ? 1 : 0; should be 1 print '12/Mar/2004' == '12/Mar/2004' ? 1 : 0; ???? print '31/Mar/2004' eq '12/Mar/2004' ? 1 : 0; should be 0 print '31/Mar/2004' == '12/Mar/2004' ? 1 : 0; ???? __END__ 1 1 0 1
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
|
|---|