in reply to tabular format of data
This prints:my @data = map {chomp; [split /:/]} <DATA>; my $width = length $data[0][0]; # Assume they're all the same length +. my $Width = @{$data[0]}; my $divider = "-" x (($width + 1) * $Width); my $topline = $divider x 2; chop $topline; say $topline; foreach my $line (@data) { print "$_|" for @$line; say "\n$divider"; } __DATA__ A:B C:D
------- A|B| ---- C|D| ----
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: tabular format of data
by deepak_4682us (Initiate) on Feb 18, 2012 at 00:54 UTC | |
by JavaFan (Canon) on Feb 18, 2012 at 01:12 UTC | |
| |
| |
by Anonymous Monk on Feb 18, 2012 at 01:04 UTC | |
by deepak_4682us (Initiate) on Feb 18, 2012 at 01:14 UTC | |
by Anonymous Monk on Feb 18, 2012 at 01:30 UTC | |
| |
| |
| |
|
Re^2: tabular format of data
by deepak_4682us (Initiate) on Feb 18, 2012 at 04:16 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |