title: What is the difference between these regex expressions - perl
body: <p>I have a line of text in a file image1.hd</p>
  
  <pre><code>axial rotation:=0.880157
  </code></pre>
  
  <p>I want the number. Using core perl I do this</p>
  
  <pre><code>open FILE, "&lt;", "$Z_DIR/image1.hd" or die $!;
    while (&lt;FILE&gt;){
      if (/axial rotation:=(\S+)/)
        {
      $axial_rot = $1;
        }
    }
    close FILE;
  </code></pre>
  
  <p>which returns the desired output of =0.880157</p>
  
  <p>I would prefer a one liner as I will do similar to a few other files. Earlier I learned of the module File::Slurp and I tried the following with positive look behind assertion</p>
  
  <pre><code>my $axial_rot = read_file("$Z_DIR/image1.hd") =~ /(?&lt;=axial rotation:=)\S+/
  </code></pre>
  
  <p>This returns 1 - regardless of the regex. How can I alter the latter regex to achieve the desired output</p>