in reply to Re: Using regex in Map function
in thread Using regex in Map function

or better perhaps:

my @out = map {substr ($_, 0, -1) . 'x'} @in;

Prints:

aaa bbb ccc => aax bbx ccx

DWIM is Perl's answer to Gödel