Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
This is just another perl newbie here.Thanks every1 for replying to my question about merging files.
.Phew! i really do have a long way to go. Anyway i was going through some C exercises i had done previously and i came across an interesting
exercise. You have to write a program to produce
the following output
Well, um i wrote the code , but since er i just baby talk perl,
the code is very big i just know that there
is a more better and more intelligent way to do it
.I will really appreciate your help perl monks if you kindly
THANKS ankur
ABCDEFGFEDCBA ABCDEF FEDCBA ABCDE EDCBA ABCD DCBA ABC CBA AB BA A A <CODE> #!/usr/bin/perl -w @store=('a'..'g'); $i=@store; $count=0; while($i>=0){ &printline($i-1,@store); &revline($i-1,$count,@store); $count++; pop(@store); } sub printline{ ($itemp,@printarray)=@_; for($j=0;$j<=$itemp;$j++){ print "$printarray[$j]"; } } sub revline{ ($it,$cou,@linarray)=@_; if ($cou==0){ for($k=$it;$k>=0;$k--){ print "$linarray[$k]"; } print '/n'; return; } $p=$cou-1; $r=2*$p + 1; for ($j=1;$j<=$r;$j++){ print " "; } for($k=@linarray-1;$k>=0;$k--){ print "$store[$k]"; if ($k==0){ print '\n' ; } } }
er i dont know formatting yet

In reply to outputting fun by ANKUR

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others romping around the Monastery: (6)
    As of 2018-06-17 22:39 GMT
    Find Nodes?
      Voting Booth?
      Should cpanminus be part of the standard Perl release?

      Results (107 votes). Check out past polls.