title: perl - How to check a value to be present in specific range?
body: <p>Is it possible to compare the value of an expression like this in perl? </p>
  
  <pre><code>if(0x100 &lt; $my_var &lt; 0x200) {
      return $my_var;
  }
  </code></pre>
  
  <p>The above way gives a syntax error.</p>
  
  <p>In perl, Is there a better way to check if the value is present in specific range?</p>
  
  <p>I don't want to use two if conditions to do this. I am sure,for this, there would a better way in any language.</p>
  
  <p>Sorry if this a very basic question. I am trying to write my first programs in perl.</p>
  
  <p><strong>Edit</strong></p>
  
  <pre><code>if($my_var &gt;0x100  &amp;&amp; $my_var &lt; 0x200) 
  </code></pre>
  
  <p>I donot like the above method. Please let me know if there is any other sophisticated way. I would be using it a lot on 64 bit addresses. Hence writing like this, would make the code look ugly. Please suggest other ways.</p>