in reply to Parsing a date from comma-delimited file
There seems to be some confusion in responders - you are splitting on a comma, because its a comma separated file. So that makes sense. (Assuming there are no commas in the data itself, of course. If thats even a possibility you should use a CSV module from CPAN.)
The code you have shown should use eq. The == comparison is forcing numeric context, taking as much of the string as it can that looks numeric, in this case everything up to the first /.
Compare:
perl -e 'print "==\n" if "12/Mar" == "12/Jun";' perl -e 'print "eq\n" if "12/Mar" eq "12/Jun";'
(Which give '==' and no output respectively)
You do say you tried eq, so you may have additional problems. If you post more code you'll get a thorough review. (Perhaps more than you want...)
You may also want to look at the many Date modules on CPAN, so you don't require a specific format.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Parsing a date from comma-delimited file
by jaco (Pilgrim) on Apr 13, 2004 at 00:34 UTC |