use List::MoreUtils qw(apply); my @array = apply { s/regex/replacement/ } @input;