N, Guruguhan (GEAE, Foreign National, EACOE) wrote:
> Hi All,
>           I have a one dimensional array @X, containing N elements. I
> would like to know how I can print this N elements in M columns? 

If you want the data to read across, then down, you can do:

   @X = 'A' .. 'Z';
   $m = 8;
   print join("\t", splice @X, 0, $m), "\n" while @X;

(this destroys the array; you can do it without destroying if necessary)

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to