in reply to What operator prepends?

Heh. Or maybe it is just a matter of perspective. Taking [id://kwaping]'s example above, one man's append is another man's prepend, if you don't care which variable you end up with:

$prepended_value .= $var;

No good deed goes unpunished. -- (attributed to) Oscar Wilde

Replies are listed 'Best First'.
Re^2: What operator prepends?
by richard.sharpe (Sexton) on Dec 09, 2019 at 13:10 UTC

    Works for variables, but not for constants:

    "prepended value" .= $var; # this reverse orientation of assignment is not supported in Perl

    Maybe future versions of Perl will allow such reverse order (for constants), and then, maybe, also appendment operator could work also in prependment mode, but more universal seems having 2 operators: .= and =. (: this could continue in meditations :).

    Appendment = appending assignment, prependment = prepending assignment. :)