在/ usr/bin中/ env的perl的
use warnings;
use strict;
my $text = 'hello ' x 30;
printf "%-20s : %s\n", 'very important text', $text;
这个脚本的输出看起来更矿石较少像这样:如何在Perl中创建列输出?
very important text : hello hello hello hello
hello hello hello hello hello hello hello hello
hello hello hello hello hello hello hello hello
...
不过,我想这样的输出:
very important text: hello hello hello hello
hello hello hello hello
hello hello hello hello
...
我忘了提及:文本应该有一个开放的结尾,因为文本行的右端应该对齐终端的大小。
我怎样才能改变我的脚本来达到我的目标?
请解释清楚 – muruga 2010-03-20 08:24:26
你说的是完全有道理的段落?这在终端上既困难又丑陋。我想你从未在CPM上使用过WordStar。 – 2010-03-20 13:05:22