title: Perl: matching strings containing slash in quotation marks
body: <p>I'm currently writing a Perl script to parse a config file. The syntax is as follows</p>
  
  <pre><code>{command parameter1 parameter2}
  </code></pre>
  
  <p>where the second parameter is optional. In the first place I just want to extract the content between <code>{</code> and <code>}</code>. Im using this code</p>
  
  <pre><code>while (&lt;FILE&gt;) {
      chomp;
      unless ($_ =~ m/^\/\//) {
              $_ =~ /^\{(.*?)\}/s;
              print $1;
  }
  </code></pre>
  
  <p>Instead of the <code>print</code> command the string will be evaluated further. My problem now is that the script just stops working with some strings</p>
  
  <p>The script works, as long there are quotation marks around the arguments. This</p>
  
  <pre><code>{exec sed 's/ClientAliveInterval\ 300/ClientAliveInterval\ 1800/\' /etc/ssh/sshd_config &gt; /etc/ssh/sshd_config.new}
  </code></pre>
  
  <p>will return the content between the brackets, but since there could be a second parameter it is now hard to distinguish the parameters without qoutation marks</p>
  
  <p>Other strings like</p>
  
  <pre><code>{exec "cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak"}
  {exec "/etc/init.d/ssh reload"}
  </code></pre>
  
  <p>work perfectly, including the quotation marks.</p>
  
  <p>But now, strings in quotation marks including a slash or a plus sign (maybe also others) just freeze the perl script at this point:</p>
  
  <pre><code>{exec "chmod +x /root/setSSHTimer.sh"}
  {exec "sed 's/ClientAliveInterval\ 300/ClientAliveInterval\ 1800/\' /etc/ssh/sshd_config &gt; /etc/ssh/sshd_config.new"}
  </code></pre>
  
  <p>Both with quotation marks. When rewriting the first to "chmod 770..." it works again.</p>
  
  <p>Any ideas what causes the problem here?</p>