Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

There were lots of discussions as how to ask a question or how not to ask a question. What I want to talk here is how to read replies.

Replies always have their own particular focuses, and not intended to talk about every aspect of a particular area. When readers read them, one should try to read the replies correctly, and get as much benefits from all those replies. Take this stream of three replies as an example:

  1. halley's Re: perl mysql question
  2. pg's Re^2: perl mysql question
  3. Thilosophy's Re^3: perl mysql question

In the first reply, halley brought up a very good point "to use placeholder". In my reply to halley, I brought another good point that, if the SQL statement is actually executed more than once, do() should be replaced by one prepare() and multiple execute()'s. Now Thilosophy became worried and thought that I might send the wrong signal, so he further elaborated the benefits of using placeholder "alone".

This stream of discussion is all good, all three posts, although have different focuses, and seemed to be in sort of disagreement, however if you read them correctly, there was actually no disagreement. Instead of disagreeing with each other, the three monks actually worked together (without them knowing), to establish a more complete answer to the question.

After you read those three posts, if you got confused and started to think which one of them is correct or wrong, then you missed the point and is not going to get as much as you can. The real point is that they were all correct in general, but simply with different focuses.

The first post focused on the benefit of placeholder. The second post says, if you want to do it right, why not go one step further. The third one was worried that the second might send the wrong signal and make peolpe think there was no benefit by using placeholder only. If you read the stream correctly, you should end up understand couple of things in general:

  • It is very important to use placeholder;
  • What do() actually does (know that do() is sort of a macro);
  • Why should you prepare a SQL statement before execute it.

The other thing is to realize that one stream of discussion cannot cover all the knowledge in even the smallest area, and there are lots of other questions and answers one can pursuit. For example, in this case, one further discussion could be what prepare actually does. Prepare actually means different thing to different database, and for the same database, different drivers might handle this differently. Even if you call prepare(), you still may not get all the benefits from one database/one driver when you compare it with another databse/another driver.


In reply to How to read the replys? by pg

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (3)
As of 2024-04-24 05:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found