in reply to Getting MySQL Data into an Array.

Are you trying something new, experientmenting, what? Are you asking why THIS doesn't work or are you really asking how to put the database into an array?

I have to be honest. I am confused why you are asking this when it is so easy to lookup. I want to give you the benefit of the doubt and say your experimenting with DBI's execute method, but then again, you neither asked the question that way, or appear to have looked at the perldoc for DBI. So, it is hard to tell. Perhaps, you need to rephrase the question (or read the perldoc).


I admit it, I am Paco

Replies are listed 'Best First'.
Re (tilly) 2: Getting MySQL Data into an Array.
by tilly (Archbishop) on Jan 06, 2002 at 20:51 UTC
    If the questioner is unaware of how to use perldoc, and most questioners indeed are, then your post amounts to saying, You are a moron for not doing something you don't know how to do. Why didn't you look up documentation you probably don't know how to find?

    That is an absolutely and utterly useless thing to say. Here is a much better way at getting across the basic point you had:

    It looks like you may not have read the documentation for DBI. If you know about it, take this as advice that you should try understanding that before asking questions. If you don't know how to find the documentation try typing perldoc DBI at the command line. To try to find out about a specific thing type </code>/execute</code> and you should jump right there.

    An alternative that many people like to use is the documentation at the website http://www.perldoc.com. Note, however, that using this is slower, and using any kind of online documentation means you always have to worry about whether you are reading documentation for a different version of the software than what you have installed locally.

    Do you see? The same basic diagnosis. Answering it takes about the same energy as what you did. The answer is far less likely to leave the other person thinking you think they are stupid. And in the likely scenario that they don't have the basic toolkit that you take for granted, the answer will be useful.
      thank you for the objective support,Tilly. It is appreciated.
      Okay, I have to say that Tilly is right on one point. If I am going to criticize the question, I should have been more specific. (I even gave Tilly a ++ vote for that point.)

      I will do that next time.

      However, my point is still valid and Tilly does not seem to recognize that. (We had a long discussion about it this morning.) While I am sure the cdherold is normally a fine programmer, s/he sounds like s/he is being lazy here.

      S/he is smart and resouceful enough to know about DBI and got those variable names from the documentation or a close proximity there of, but sounds here to by saying:

      "I tried once, it failed. Help me!"

      I am not trying to scare off some relative newbie. I am trying to challenge them to think things through before asking the questions. Try it a few different ways, do some research. It does him/her a disservice to write their code for them.

      I don't believe my tone was as harsh as Tilly says. If so, it was not my intention to sound harsh. I truely wonder if he/she was attempting to use execute() in a new way. If so, I commend that, but the question was worded poorly if that is the case.


      I admit it, I am Paco.
        Please stop trying to justify yourself.

        Your point is not valid. As the old saying goes, Don't make an ass of u and me. The questioner does indeed know of DBI and used the variable names that its documentation uses. That tells you little. That just means that said person somewhere has seen code that uses DBI, and that code used the same variable names that DBI does. You have no idea where that code came from. It could be from DBI, yes. It could be from an old database script that happened to be laying around. Perhaps it is from a book he picked up. There are a lot of web pages you can get DBI code samples like that from - not a few of which are at perlmonks in fact. (Which happens to be the only Perl resource we know this person knows about. And we only know that because this is where the question was asked.)

        And for most of those possible sources, the odds are very good that the variable names chosen would be the same as (or at least similar to) the ones in the DBI documentation. But if the questioner had actually had the DBI documentation to refer to, there would be a lot of likely looking select methods they would be likely to try.

        So you do not know that they have ever seen anything looking like documentation. (In fact I think it is unlikely that they had.) And given that most beginning Perl programmers that I have seen don't know where to find documentation, this is not a good assumption to make.

        As for how harsh you were, I summarized how I think I would have reacted to your post had I asked the question and didn't know enough about the Perl world (note that the questioner had not used Perl in a very long time - and said that up front) to know where to find the answers.

        Furthermore I advise you to reflect on your behaviour in chatter when multiple people objected to the tone implied in your post. I am paraphrasing from memory, but I think that statements like, If they can't stand the heat then they should get out of the fire and, Perhaps it will be incentive for him to solve his own problem next time indicates that - whatever your intention, you apparently didn't much care if it came off as belittling and rude. Now that may have been just frustration that people were not agreeing with you, but those aren't the attitudes we really want to encourage around here.

        (On a similar note we also try to avoid having many threads which are this heated. Which is why what I really want to see happen is for this discussion to be dropped, for you to think about it, and for the issue to simply never come up again...)

Re: Re: Getting MySQL Data into an Array.
by cdherold (Monk) on Jan 07, 2002 at 08:31 UTC
    I usually send these questions in while I'm working on them on the side in a sort of parallel processing. For me, it's much more productive to get input along the way from the very knowledgable monks which is complementary to what I learn myself ... the monks almost always have a wise word from which I am able to grow further.

    A bonus, is that every once in a while a venerated monk will have a very valuable tid-bit of information which is off the beaten path (my path anyways). That happened this time and I thank that monk (miyagawa) for taking the time to share his wisdom.

      I would ask that you rethink using PM as a form of "parallel processing". If there are obvious resources that you know about which you have not yet checked, it saves time for all of us for you to check them first. Based on experience you will run across just as many unexpected nuggets, it will save you time, and we will have time and energy to devote to questions that help people more directly..

      Note that even while deploring the tone of a response to you I reinforced the basic point that documentation is to be checked first. The answers that come here are a volunteer resource. Furthermore the people giving them are often experienced and qualified professionals. Our time and energy is likely worth at least what yours is if we were not choosing to volunteer it, so please treat it that way. (And our not entirely secret plot is to infect you with the attitudes, values, and knowledge that make us able to volunteer so that you turn around and eventually do likewise. Now please look into this white light and forget all about this...)

      For more on the cultural underpinnings that lead to our acting this way, I highly recommend Re: Newby Query Comment by davorg.