I read the OP's previous post and there exists evidence of improvement; therefor, I suggest you guys are being overly harsh. The poster included his output and the desired output; which is more that most posters give us. Not everyone can be an instant Perl God.

Your script sudib_dg77, as posted, contains a simple but insidious error in that early on there is a statement lacking a terminating semicolon. This will cause the rest of the script to not parse properly. Further, it will cause small changes in the script to result in differing behaviours. A situation similar to the troubles you have been encountering. I don't know if this was part of code that you edited out for this post, as it appears to be, or if this is reflected in you production code. If the latter, posting incomplete code is not the same as posting simplified code and is less than helpful.

Your code lacks proper formating in that the indentations seem to be added at random. While the perl compiler doesn't care, those of us reading the code are confused by random indentations. Please only indent statements that are contained inside brackets or are continuation of partial lines. I had to run your code through perltidy in order to read it without straining my poor Pooh-brain. Consequentially, check out perltidy. It's an excellent tool for the new perler.

The documentation for DBI fetchall_arrayref contains this small bit of advice:

"If called in a scalar context for a statement handle that has more than one column, it is undefined whether the driver will return the value of the first column or the last. So don't do that."

Excellent advice! It appears that you are doing exactly that, ie. fetching into a scalar $row. This will cause loss of data as you describe.

Good luck. And I'll apologize for the other's harshness. I hope it doesn't unduly discourage you.

<update> Update: strikeout misquote.</update>


s//----->\t/;$~="JAPH";s//\r<$~~/;{s|~$~-|-~$~|||s |-$~~|$~~-|||s,<$~~,<~$~,,s,~$~>,$~~>,, $|=1,select$,,$,,$,,1e-1;print;redo}

In reply to Re: Please help.. by starbolin
in thread Please help.. by sudip_dg77

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.