my $cant; $cant =shift || 60 ; ## DEFAULT: 60 COLS. use Text::Format; my $anco; ## 1ST.LINE LEFT MARGIN $anco = length($1) if ($text=~/^( +)/);## MARGIN? $anco = 0 if ($anco < 1 or $anco >= $cant);## ERROR? $cant -= $anco; ## FORMAT WITHOUT LEFT MARGIN TO ADD my @tod = (split(/\n+ */,$text)); $text=new Text::Format({ columns => $cant, text => \@tod, justify => 1, firstIndent => 0}); $result.= join(" ", ($text->paragraphs())); if ($anco) ## FORMAT WITH 1ST. LINE MARGIN... { @tod= (split(/\n+ */,$result));## GET EVERY LINE my $cant= ' ' x $anco; ## LEFT MARGIN IN SPACES $result = $cant. join("\n$cant",@tod); ## ADD LEFT MARGIN AND OUTPUT } $CLIP->Set($result); ## TO THE CLIPBOARD...