Hi haukex,

first, I'm really sorry, I should not have used the work "dogmatic." I understand it might be considered a bit derogatory, and I really did not mean that.

Then, whether you're using the DBI quote subroutine or the core Perl solutions I suggested, you need to validate the input data beforehand anyway if it's coming from an external source.

I was perfectly happy with the solutions you suggested (and I think I said so), I only reacted to the sentence: "this is the very least you should do - don't go and try to quote the strings yourself."

Finally, I really think that somebody learning Perl and not knowing how to quote a bunch of words should learn how to do it in pure Perl first.

I have seen recently at our job some interns knowing apparently almost everything about the Symphony framework and not being really able to write five lines of correct PHP (I even had to help them and fix their code although my knowledge of PHP is close to nothing).

With all due respect to what Your Mother and you said, I think developers should learn to do things the hard way in the language they use before using props and crutches available in packages, libraries, modules, and frameworks. Well, maybe I am wrong, after all, I must admit that don't know how the library that I use computes the sin function. Perhaps it is just me being too old school.


In reply to Re^6: How to add quotes to comma separated values in a String (updated) by Laurent_R
in thread How to add quotes to comma separated values in a String by dirtdog

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.