__DATA__ TABNAME 06100 01010 06000 00110A # The above is header which is present in @header !W31801!-->!919!-->!90200809!-->!840!-->!MO! !W31801!-->!919!-->!902008!-->!74!-->!MO! #The above are the data present in @data array # iam doing below ... my $disp = sprintf("-%10s\n",join("\t",@header)); print $disp; # i printed header foreach my $line (@data){ my @arr = split(/-->/,$line); my $disp = sprintf("-%10s\n",join("\t",@arr)); print $disp; } # From above iam cant achieve what i need, the resultant data is out of format... # All i need is , no matter whats the size of data or header, i want to print each column with width of 10 characters . __DATA__ -TABNAME 06100 01010 06000 00110A -!W31801! !919! !90200809! !840! !MO! -!W31801! !919! !902008! !74! !MO! # As you can see output , headers are not alighned properly, i need headers and corresponding data to be left alighned and in same column..