|
|
| Perl-Sensitive Sunglasses | |
| PerlMonks |
Infinite loop with Text::xSVby patgas (Friar) |
| on Mar 25, 2002 at 14:04 UTC ( [id://154180]=perlquestion: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.patgas has asked for the wisdom of the Perl Monks concerning the following question: (Seeing how this module was written by tilly, let me take this opportunity to show my appreciation for all the work and help he's given me and everyone in the community. Thank you. :) I'm encountering an infinite loop while using Text::xSV to parse my CSV files. I chose to use Text::xSV because a lot of records may contain a newline in their fields. I should also caution that the file may not be proper CSV, and I wouldn't know any better, although I've looked around, and they look fine to me. Here's the section of xSV.pm that I believe it's getting stuck on:
So inside the while loop, $1 is never true, and I'm always running into the else clause. Also, the entire second if-block is never executed, which I assume is why it's stuck in the loop. Now seems like a good time to show my sample data and test code: sample.csv
test.pl (The real application is a big CGI graph producer, but after bogging down the server a couple times, I figured I'd better just test it locally :) Both the bind_header() and get_row() subs use the aforementioned _get_row(), so commenting out one or the other shouldn't matter.
"As information travels faster in the modern age, as our days are crawling by so slowly." -- DCFC
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||