#!/usr/bin/perl print "Content-type:text/html\n\n"; $parval="stat1_val"; if($parval eq "stat1_val"){ print "Statistics of RUNS"; my $var ; my $buffer=$ENV{'QUERY_STRING'}; my($path1,$filename)=split('#',$buffer); print "$path1 and $filename\n"; print "
"; } 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