in reply to How not to remove trailing empty strings from an array

Close, but subtly different (imho), it

Replies are listed 'Best First'.
Re^2: How not to remove trailing empty strings from an array
by ambrus (Abbot) on Apr 16, 2013 at 16:51 UTC

    My actual fix was

    pop @msgstr while @msgstr && !length($msgstr[-1]);
Re^2: How not to remove trailing empty strings from an array
by LanX (Saint) on Apr 16, 2013 at 17:21 UTC