in reply to Print Array items in Fixed width
my @header = qw( TABNAME 06100 01010 06000 00110A ); my @data = qw( !W31801!-->!919!-->!90200809!-->!840!-->!MO! !W31801!-->!919!-->!902008!-->!74!-->!MO! ); my @fields; #declare here so it's visible to format below foreach my $line (@data) { @fields = split(/-->/, $line); write; } format STDOUT_TOP = @<<<<<<<<< @<<<<<<<<< @<<<<<<<<< @<<<<<<<<< @<<<<<<<<< @header . format STDOUT = @<<<<<<<<< @<<<<<<<<< @<<<<<<<<< @<<<<<<<<< @<<<<<<<<< @fields .
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Print Array items in Fixed width
by harishnuti (Beadle) on Aug 01, 2008 at 02:59 UTC | |
by BrowserUk (Patriarch) on Aug 01, 2008 at 03:38 UTC | |
by broomduster (Priest) on Aug 01, 2008 at 08:37 UTC | |
by harishnuti (Beadle) on Aug 01, 2008 at 10:09 UTC |