Adding an entry for a matched $module What would be the most efficient way to write the following code in Perl:

       my $index = 0;
       foreach ( @spec ) {
          if ( $module =~ m/$_/ ) {
         splice(@spec, $index, 0, $module);
             last;         
          }
          $index++;
       }


This works fine but just seems a little wordy. The idea is that where I find a match for $module in the array I add an entry. I want to keep the array in a certain order and sorted.
You want "more efficient wordiness"??? I presume you're not asking for golfing, but for code that's more readable from conciseness.

@spec = map { $_ eq $module ? ($_, $_) : $_ } @spec;