- The "chomp issue" was that you expected chomp to return the chomped string but it instead returns the number of characters chomped.
- I don't believe you needed to remove the primary key. I think you had some other issue but that you changed more than one thing at once. If the column values are unique or you are going to select via that column you want an index or unique index. As you started with problems attempting to read from a file with <> I suspect you somehow where reading from stdin and hence it looked like your script was hung. That is why I suggested pressing ctrl/d.
It was suggested you inserted the values as parameters and that is still the best way to do it. As you have it you are having to build a SQL string each time when in fact before your while loop you could simply do one prepare with placeholders and then only call execute inside the while loop. It would also avoid all those quote calls.
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:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||