У меня есть текст в этом шаблоне:
In 1935 he was asked to document the principal dancers and productions and
George newly .
he continued to shoot fashion
Bergdorf Goodman and Saks Fifth
started a series of photographs .
, и я хочу преобразовать каждый абзац в одну строку, разделенную "\ n", т.е. на выходе будет:
In 1935 he was asked to document the principal dancers and productions George newly .
he continued to shoot fashion Bergdorf Goodman and Saks Fifth started a series of photographs .
Как я могу отформатировать такую вещь с помощью Perl, может кто-нибудь привести пример?
Я пытался использовать Text :: Wrap, как показано ниже, но получал нежелательные результаты
$Text::Wrap::separator=' ';
my $text=fill("","",$text);