#dir test
$file='d:\sysctl.conf';
open (MYFILE, "$file") || die ("Could not open file");
#@a = <MYFILE>;
%values =('fs.file-max' =&gt; 6815744 ,'fs.aio-max-nr' =&gt; 1048576 ,'kernel.shmall' =&gt; 2097152,'kernel.shmmax' =&gt; 2147483648,
'kernel.shmmni' =&gt;4096 ,'kernel.sem' =&gt; '250 32000 100 128' ,'net.ipv4.ip_local_port_range' =&gt; '9000 65500',
'net.core.rmem_default' =&gt; 4194304,'net.core.rmem_max' =&gt; 4194304,'net.core.wmem_default' =&gt; 262144,'net.core.wmem_max' =&gt; 1048576);
foreach $show (<MYFILE>)
   {
     if($show =~ /\=/)
       {
        @value=split(/=/,$show);
        if(exists $values($value[0]))
           {
                if($value[1] &gt;= $values($value[0]))
                 {
                 }
           }
    ##   print   "$value[0] =&gt;$value[1]\n";
       }
     else
      {
         $show='afa';
      }
   }
    while (($key,$va)= each %values)
     {
         print "$key = $va\n";
      }