in reply to Appending a single Scalar after a match

Hello SavannahLion,

You were so close! In list context, the matches are returned as a list, not an array, and you can subscript a list, so just remove the initial $ (and no need to put $k into parentheses):

$k .= ($t =~ /^\s*(.*?)\s*$/g)[0];

:-)

Hope that helps,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

Replies are listed 'Best First'.
Re^2: Appending a single Scalar after a match
by SavannahLion (Pilgrim) on May 25, 2015 at 14:51 UTC

    Oh... ha! ha! No way! :D
    I kept fiddling with it by adding $ or @ thinking it needed to pulled apart as an array.
    I knew the answer had to be in there somewhere. So many thanks!