attempting again to use pre tags successfully; using them in conjunction with code tags seems not to display wide characters properly

Yes, the issue with <code> vs. <pre> tags and Unicode characters only working in the latter is a known issue on PerlMonks.

I'm still fishing for how I format this into homogenous-looking paragraphs.

Have a look at the core module Text::Wrap. Here's one way, I'm using the "paragraph mode" supported by $/ to read the file:

use warnings; use strict; use open qw/:std :utf8/; use Text::Wrap 'wrap'; open my $fh, '<:raw:encoding(UTF-8)', '1.promises.txt' or die $!; local $/ = ''; local $Text::Wrap::columns = 71; while (<$fh>) { s/^\s+|\s+$//mg; if (/\A\w+\z/) { print ' ' x int( (71-length)/2 ), $_, "\n"; next; } s/\n|\s{2,}/ /g; print wrap(' 'x5, '', $_), "\n"; } close $fh;

Output:

                               Oбещания
     Если эта фаза нашего развития болезненна для нас, мы будем
удивлены, когда половина пути окажется позади. Мы познáем новую
свободу и новое счастье. Мы не будем сожалеть о нашем прошлом и вместе
с тем не захотим полностью забывать о нем. Мы узнаем, что такое
чистота, ясность, покой. Как бы низко мы ни пали в прошлом, мы поймем,
что наш опыт может быть полезен другим. Исчезнут ощущения ненужности и
жалости к себе. Мы потеряем интерес к вещам, которые подогревают наше
самолюбие, и в нас усилится интерес к другим людям. Мы освободимся от
эгоизма. Изменится наше мировоззрение, исчезнут страх перед людьми и
неуверенность в экономическом благополучии. Мы интуитивно будем знать,
как вести себя в ситуациях, которые раньше нас озадачивали. Мы поймем,
что Бог делает для нас то, что мы не смогли сами сделать для себя.
     Не слишком ли это звучит многообещающе? Нет. Все это произошло со
многими из нас, с одними раньше, с другими позже. Все это становится
явью, если приложить усилия.
                               Promises
     If we are painstaking about this phase of our development, we
will be amazed before half through! We are going to know a new freedom
and happiness. We will not regret the past nor wish to shut the door
on it. We will comprehend the word serenity and know peace. No matter
how far down the scale we have gone, we will see how our experience
can benefit others. That feeling of use- lessness and self-pity will
disappear. We will lose interest in selfish things and gain interest
in our fellows. Self-seeking will slip away. Our whole attitude and
outlook upon life will change. Fear of people and of economic
insecurity will leave us. We will intuitively know how to handle
situations which used to baffle us. We will suddenly realize that God
is doing for us what we could not do for ourselves.
     Are these extravagant promises? We think not. They are being
fulfilled among us—sometimes quickly, sometimes slowly. They will
always materialize if we work for them.

In reply to Re^3: using Path::Tiny and reformating result by haukex
in thread using Path::Tiny and reformating result by Aldebaran

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.