in reply to stack array to array of arrays
List::MoreUtils offers a similar functionality:
use strict; use warnings; use List::MoreUtils qw/natatime/; my @array = qw(a b c e 1 2 3 4 5 3 f); my $it = natatime 3, @array; while ( my @vals = $it->() ) { print "@vals\n"; }
Output:
a b c e 1 2 3 4 5 3 f
BTW - I use this for generating multi-line output...
Here's another option for multi-line output (generated from a single line):
use strict; use warnings; use Text::Wrap; $Text::Wrap::columns = 18; my $text = <<END; BTW - I use this for generating multi-line output - tables and such. END print wrap(" ", '', $text);
Output:
BTW - I use this for generating multi-line output - tables and such.
Hope this is helpful.
|
|---|