sub yoink { my ($arr_ref, $kill_pattern) = @_; my @out_arr; for (@$arr_ref) { push @out_arr, $_ unless (/^$kill_pattern$/) } @$arr_ref = @out_arr; }