title: How to modify the .ini file in perl
body: <p>I am trying to write a script which will modified 4 lines in InI file : </p>
  
  <p><strong>Below is the content of my Ini file:</strong> </p>
  
  <pre><code>gEnableImps=1
  gEnableBmps=1
  gEnableSuspend=3
  gDot11Mode=0
  gEnableHandoff=0
  gRoamingTime=0 
  
  
  Intf0MacAddress=000AF6798980
  Intf1MacAddress=000AF5788981
  Intf2MacAddress=000AF2898982
  Intf3MacAddress=000AF5893983
  
  
  InfraUapsdVoSrvIntv=0 
  InfraUapsdViSrvIntv=0
  InfraUapsdBeSrvIntv=0
  InfraUapsdBkSrvIntv=0 
  
  
  DelayedTriggerFrmInt=18000
  
  
  gEnableFWRssiMonitoring=0  
  </code></pre>
  
  <p><strong>I have to modify below four line every day :</strong> </p>
  
  <pre><code>Intf0MacAddress=000AF6798980
  Intf1MacAddress=000AF5788981
  Intf2MacAddress=000AF2898982
  Intf3MacAddress=000AF5893983
  </code></pre>
  
  <p>In above lines I need to change 6798980, 5788981,2898982,5893983 part I mean in each number any to consecutive digit should get change and the change digit should not get copy of another number i.e in each number unique digit should change. </p>
  
  <p><strong>Exp :</strong> </p>
  
  <pre><code>6798980  after change -&gt; 6791280
  5788981  after change -&gt; 5783481   
  2898982  after change -&gt; 2897682
  </code></pre>
  
  <p>I have written code but i am unable to change the number .. can any body give me some help </p>
  
  <p><strong>My Script:</strong> </p>
  
  <pre><code>#!/usr/bin/perl -w
  use strict;
  open(FH,"+&lt;","WCN1314_qcom_cfg.ini")
                         or die "File not found";
  
  my @lines=&lt;FH&gt;;
  foreach my $line (@lines)
  {
    if(($line =~ /Intf0MacAddress/ ||$line =~ /Intf1MacAddress/||$line =~ /Intf2MacAddress/||$line =~ /Intf3MacAddress/) )
  {
    print "$line\n";
  }  
  else
  {
    print "Not found\n";
  }
  }  
  </code></pre>