sub print_wrap { my ($wrap_len, @list) = @_; my $pos = 0; for my $item (@list) { my $len = length $item; if ($len + $pos > $wrap_len) { print "\n"; $pos = 0; } print "$item "; $pos += $len + 1; } } my @list = qw/abcd efghi jkl mnop qrst uvwxyz/; print_wrap 10, @list;
In reply to Re: Print to file options
by lostjimmy
in thread Print to file options
by erez_ez
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |