I have a perl loop which is as follows:

while (my @row = $_read_sth->fetchall_arrayref) { @ret_values = Dumper @row, @{$_read_sth->{NAME}}; print "@ret_values\n"; }
It is returning me the following output.

$VAR1 = [ [ 'Encumberances to look into:' ] ]; $VAR2 = 'Account'; $VAR3 = 'Symbol'; $VAR4 = 'Sedol'; $VAR5 = 'Security Name'; $VAR6 = 'Encumbered'; $VAR7 = 'Enc. qty'; $VAR8 = 'Borrow Acct'; $VAR1 = [ [ '15140EQJP_55121', 'DD UN', '2018175', 'DU PONT (E.I.) DE NEMOURS', 'BO data mismatch', '275000.0', '98027EQJP_54981' ], [ '15140EQJP_55121', 'AFL UN', '2026361', 'AFLAC INC', 'BO data mismatch', '100000.0', '29075EQJP_54301' ], [ '15140EQJP_55121', 'SLM UN', '2101967', 'SLM CORP', 'BO data mismatch', '180000.0', '98002EQJP_54161' ], [ '15140EQJP_55121', 'CMI UN', '2240202', 'CUMMINS INC', 'BO data mismatch', '100000.0', '98059EQJP_53421' ], [ '15140EQJP_55121', 'DOW UN', '2278719', 'DOW CHEMICAL', 'BO data mismatch', '175000.0', '98027EQJP_54981' ],
Now I need to format the above output in the following format

Encumberances to look into: Account, Symbol, Sedol, Security Name, Encumbered, Enc. qty, Borrow Ac +ct 15140EQJP_55121, DD UN, 2018175, DU PONT (E.I.) DE NEMOURS, BO data mi +smatch, 275000.0, 98027EQJP_54981 15140EQJP_55121, AFL UN, 2026361, AFLAC INC, BO data mismatch, 100000. +0, 29075EQJP_54301 15140EQJP_55121, SLM UN, 2101967, SLM CORP, BO data mismatch, 180000.0 +, 98002EQJP_54161
Any formating suggestions how this can be done?

Also the problem I am facing is that when I am running the below loop it goes into an infinite loop and doesn't stop. Any idea how to stop it also?

while (my @row = $_read_sth->fetchall_arrayref) { @ret_values = Dumper @row, @{$_read_sth->{NAME}}; print "@ret_values\n"; }

In reply to Formatting question?? 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.