hi monks, can any one help me actually i am having some set of directories like batch1, batch2 etc and in each directory they is some number of text files like file1.txt, file2.txt etc.
#!/usr/bin/perl print "Content-type:text/html\n\n"; $parval="stat1_val"; if($parval eq "stat1_val"){ print "<b>Statistics of RUNS</b>"; my $var ; my $buffer=$ENV{'QUERY_STRING'}; my($path1,$filename)=split('#',$buffer); print "$path1 and $filename\n"; print "<html><head><body><form name=frm1>"; for my $path ( grep -d, </var/www/directory/*> ) { my($first,$second,$third,$directory,$batches)=split('/' +,$path); my($ss,$ss1)=split('batch',$path); print "<div id=$ss1 name=file><li><a href=?$path#$var o +nClick='oncli();'>$ss1 $batches</a></li></div>"; } my @var=`ls -f $path1| grep '.txt\$'`; foreach $var(@var){ $var=~s/\s+//g; print qq{<div id=siva><li><a href=# onclick="javascript +:window.open('readfile.pl?$path1/$var','To Read theText File','width=500,height=600')"> $i $var</a></li></div>}; } print "</form></body></html>"; } my program output is like this 1 batch1 2 batch2 3 batch3 4 batch4 5 batch5 file2.txt file5.txt file1.txt file3.txt but i need it in the following format 1 batch1 file2.txt file5.txt file1.txt file3.txt 2 batch2 3 batch3 4 batch4 5 batch5
Thanks in advance

In reply to how to format perl/cgi output in web page by sanku

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.