in reply to Trim blanks from the beginning and end of a multi-line string

Another way to do it: Text::Trim.
#!/usr/bin/perl -l use strict; use warnings; use Text::Trim; $|=1; my @strings= <<"EOF"; This is a sentence in a paragraph. This a sentence in a paragraph. This is a sentence in a paragraph. This is a sentence in a paragraph. This a sentence in a paragraph. This is a sentence in a paragraph. EOF my $trimmed = trim(@strings); print "\"$trimmed\"";

Replies are listed 'Best First'.
Re^2: Trim blanks from the beginning and end of a multi-line string
by kenclark (Novice) on Jan 29, 2012 at 17:49 UTC
    And another great solution. Thanks everyone for the help.