- or download this
use strict;
use WWW::Mechanize;
...
$text =~ s/<[^>]*>//g; # Strip HTML tags
$text =~ s/(?<!\n)\n(?!\n)/ /mg; # Combine lines
$text =~ y/ //s; # Squash multiple spaces
- or download this
my $len;
$text =~ s/((\S+)(?=\n|\s)|\n)/ # Reformat plain text
...
$1
}
/mge;
- or download this
# after some playing around, I came up with the
# following regex that does wrapping at column
...
$text =~ s/(.{50,60}(?<=\s\b))/$1\n/mg;
print "$text\n";
- or download this
START's reply
...
at the neural level. Current work focuses especially on
understanding the role of vision, language, and motor
computation in general intelligence.