I want to output strings into eight columns, but I want to keep the spacing the same. I don\'t want to do it in HTML, but I am not sure how to do it normally. Example:
You could use Perl's format. This is probably the "complicated" method that you don't understand, most likely because it gives you many options (left|center|right justification/padding, leading 0's, etc).
Perldoc Example:
Example:
format STDOUT =
@<<<<<< @|||||| @>>>>>>
"left", "middle", "right"
.
Output:
left middle right
Here's another tutorial.
#!/usr/bin/perl -w
use strict;
sub main{
my @arr = (['something1','something2','something3','something4','something5','something6','something7','something8']
,['else1' ,'else2' ,'else3' ,'else4' ,'else5' ,'else6' ,'else7' ,'else8' ]
,['another1' ,'another2' ,'another3' ,'another4' ,'another5' ,'another6' ,'another7' ,'another8' ]
);
for my $row (@arr) {
format STDOUT =
@<<<<<<<<<<<< @<<<<<<<<<<<< @<<<<<<<<<<<< @<<<<<<<<<<<< @<<<<<<<<<<<< @<<<<<<<<<<<< @<<<<<<<<<<<< @<<<<<<<<<<<<
@$row
.
write;
}
}
main();