The part generation code can be condensed a little through use of a regex:
use strict; use warnings; my $n = shift; my $text = do {local $/; <DATA>}; $text =~ s/\n/ /g; my @lines = $text =~ /(.{1,$n})\s+/g; print "$_\n" for @lines; __DATA__
which generates the same output given the same input as the sample above.
In reply to Re^2: A Little String Help Please
by GrandFather
in thread A Little String Help Please
by craigt
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |