Help for this page
# build a regex to match just your keys my $removers = "^(?:" . join ("|", map { quotemeta $_ } @text_remove) +. ") "; ... # strip the patterns from the beginning of each line. @xlate_data = map { s/$remove//; $_; } @xlate_data;
# use whatever delimiter makes sense here. I'm assuming # you don't have newlines at the ends of the elements already. ... # back to an array @xlate_data = split/\n/, $full_string;