in reply to Print Array items in Fixed width
Formatting fixed width output is often easier with pack:
<>Gives#! perl -slw use strict; print pack '(A10)*', split ' ', <DATA>; while( <DATA> ) { chomp; print pack '(A10)*', split '-->', $_; } __DATA__ TABNAME 06100 01010 06000 00110A !W31801!-->!919!-->!90200809!-->!840!-->!MO! !W31801!-->!919!-->!902008!-->!74!-->!MO!
c:\test>junk4 TABNAME 06100 01010 06000 00110A !W31801! !919! !90200809!!840! !MO! !W31801! !919! !902008! !74! !MO!
|
|---|