in reply to Balloons msg
$requirement=~s/. /.\\n/g; $requirement=~s/, /,\\n/g;
...
... if it's taken from an array the balloon is shown as a single line where \n is shown as a part of string.
Something like $requirement=~s/. /.\\n/g substitutes a literal '\n' (backslash character '\' followed by an 'n' character) into the $requirement string. You want \n instead:
$requirement=~s/. /.\n/g;
(Update: Remember that the replacement field of the s/// operator follows double-quote string interpolation rules unless '...' (single-quote) delimiters are used.)
Update: A more concise and general substitution would be
$requirement =~ s{ (?<= [,.]) [ \t] }{\n}xmsg;
to cover both cases in one swell foop.
Give a man a fish: <%-{-{-{-<
|
|---|