in reply to Re^4: modify list through grep
in thread modify list through grep

for my $p ( @patterns ) { my $found= 0; for my $last ( ( grep /$p/, @values )[-1] ) { $last .= '.'; # whatever mod you want $found= 1; } push @values, "string $p" if ! $found; }

- tye