How to do multiple word and value replacement in a multiple line at one time :    

    Lets say I have multiples like this

my input lines:

  

       "stack overflow version {5} my new version"
       "stack exchnage version {10} my new version"
       "perl  scripting version 5.14 my new version"
       "segmentaion falult happen {5} if the memory is not freed"
       " my college 30 new xxxx"

 

I want to replace value inside parenthesis and the value is not  
 constant it will be vary by file by file.

  
  `My Approaches`:
  
  

  

    use strict;
      use warnings;
      my $old_parameter='stack overfolw version';
      my $new_parameter;
      my $old_value={5};
      my $new_value=' ';
      my $filename ='input.txt'
      
      open my $fh, "<", $filename or die "Couldn't open input file: $!";my file
    
      while<FH>
      {
       if ($old_parameter) and ($old_value)
       {
        s/($old_value)/(new_value);
       }

 the above code will replace the value if the value is constant but if the  
 value is vary lets say (1--100) and also I want to do  
 replacement at one time all the line.
 then what would be the best approach ?


  




