in reply to repeated replacement regex

# Untested code my @replacements = ( ... ); while (<>) { my $i = 0; 1 while s/\d{5}/$replacement[$i++]/; }

Abigail

Replies are listed 'Best First'.
Re: Re: repeated replacement regex
by Hofmator (Curate) on Feb 11, 2003 at 10:07 UTC
    Nice solution with one little caveat, none of the replacements should match '\d{5}' ...

    -- Hofmator

      Thanks a lot
      Thats working just right for me