in reply to Re^9: Perl Database Entries
in thread Perl Database Entries

Addendum

And as a seasoned member, you would be more progressive in your didactic efforts if your prose were less drenched with condescension and judgmental overtones.

In general i am less inclined to be "didactic" and more likely to be "Socratic" instead. What i saw was someone who had done a very strange thing "|\@csv" in their original post, who seemed to have no idea what DBI/DBD was doing for them $api_results->fetchrow_array()) and complained about an error message they did not seem to have researched themselves. Yet thru questioning i was able to drag more information out of you about the actual problem set.

You then showed us the results of the curl to jg pipe (well with the "funny tee") and i realized i didnt want to walk you thru using a CSV module to parse that and the double quotes would mess up any simple split and proposed a new path. When i use LWP it takes a half a dozen utility statements to set up a ua,request with possible headers, test for a valid response, and selecting the decoded output besides doing the actual request itself. And i prefer to do that so im sure of what i am doing rather than guess on on what something like LWP::SIMPLE is doing in the background. You had a curl request that seemed to work and i would just let you to deal with it failing on a 4/500 error response rather than try to explain what of of that utility was doing. I showed a method that would let you continue to use curl, but "skip jg" and CSV and go directly to JSON. And i thought you did pretty good by finding my cut and paste error.

But then you come back with more errors, and imply that you hadnt tried to solve the problem yourself. you claimed that $api_result was something it could not have been. If you had run your initial statement it would not have been that because of the strange final pipe ("|$arraysomething>..") or if you had run my change it would have been a json string. Your claim showed that you had not even done a print $api_results; to see what was in it before complaining about an error that not would have happened if you did what i suggested.

Then you came back and listed something as your $api_results that again could not have been what was in it. It was missing both an initial bracket and a double quote. And mysteriously the error changed without you admitting you had changed something or telling us what you changed. And i saw what you had done with the assignment to an array, and the change to the $row loop, again without mentioning it. It became clear that you dont understand array/hash references and in changing it to an array reference you had no clue as to what you did and how it affected the $row loop. Nor did you understand qw and what the added commas in it affected. After figuring out what was wrong with the json you posted i did realize what those strange names to jg were doing and proposed a rather simple solution to deal with the names you were already using. poj showed you how to do something similar with more basic hash references. but if you didnt understand the difference between  my $unjson=$jason->... , and my @unjson=$json-> i doubted you would understand that that is doing.

So yes i doubted you ability to understand what you were trying to do, and yes i doubted your ability to implement more complex LWP or CSV calls, and i didnt think you would have a clue about what the $base loop was doing. I was hoping it might press you to learn about references to understand the code i had presented.

And yes, i was pissed that you lied to us when you posted things as a fact that you knew were not true. You did not even take the time to add a print $api_results."\n"; and cut and paste the output to us, instead taking shortcuts that did not present what you said they did.

And yes, you were complaining about error messages you did not seem to try to have put any effort into figuring out for yourself before coming to us for help. Just like others who come here just wanting only a solution rather than any knowledge.

Hail, after die $dbh->errst$ i doubted your ability to even cut&paste.

Yet rather than blow you off, i still put effort into presenting a solution, while pointing out places i felt you had disrespected what the monks are trying to do here.

Yet you want to paint me as the "bad guy" in this? Or is it because you knew i was right about all of this that you are are trying to save face by barking back at me ? I think the answer is clear. Well nobody is going to accuse you of not having chutzpah