/usr/bin/env perl
use warnings;
use strict;
my $text = 'hello ' x 30;
printf "%-20s : %s\n", 'very important text', $text;
La salida de este script es más mineral menos así:!¿Cómo puedo crear una salida columnar en Perl?
very important text : hello hello hello hello
hello hello hello hello hello hello hello hello
hello hello hello hello hello hello hello hello
...
pero me gustaría una salida como esta:
very important text: hello hello hello hello
hello hello hello hello
hello hello hello hello
...
I olvidó mencionar: el texto debe tener un extremo abierto en el sentido de que el extremo derecho de las líneas de texto debe alinearse correspondiente al tamaño de la terminal.
¿Cómo podría cambiar mi script para alcanzar mi meta?
favor explicar claramente – muruga
¿Estás hablando de los párrafos plenamente justificados? Eso va a ser duro y feo en una terminal. Supongo que nunca trabajó con WordStar en CPM. –