![](/img/trans.png)
[英]Array Prints like List but its a single integer in variable explorer? Why?
[英]Is there a module that prints a list like `ls -C`?
是否有一个以ls -C
方式打印(或帮助我打印)其元素为字符串(标量)的列表的模块?
类似于以下虚构程序:
use strict; use warnings;
use Unknown::Module;
my $ls = new Unknown::Module (columns => 3);
$ls -> print_ls_C qw(abc def ghi jklmnop q rst uv wxy z);
输出应该是这样的
abc jklmnop uv
def q wxy
ghi rst z
use Perl6::Form;
my $cols = shift || 3;
my @list = qw(abc def ghi jklmnop q rst uv wxy z);
print form q/ {:[{*}[:} / x $cols, ( \@list ) x $cols ;;;
__END__
abc jklmnop uv
def q wxy
ghi rst z
这是来自demo_columns示例,请参见https://metacpan.org/source/DCONWAY/Perl6-Form-0.04/demo中的更多示例
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.