title: perl given-when structure syntax error
body: <p>I'm trying using the given-when structure to write a little number-guessing program but my terminal keeps giving me syntax errors, anybody have any idea what could go wrong?</p>
  
  <pre><code>use strict;
  my $secret = int(1 + rand 100);
  my $flag = 0;
  my $guess;
  print "Here\n";
  while($flag == 0){
      print "Please guess a number:\n";
      chomp($guess = &lt;STDIN&gt;);
      given($guess){ #-------------- line 13
          when($_ &lt; $secret){print "Too Low\n"}
          when($_ &gt; $secret){print "Too High\n"}
          when($_ == $secret){print "You've guessd it!";$flag = 1}
          default {print "User chose to exit";$flag = 1}
      }
  }
  </code></pre>
  
  <p>Error message:</p>
  
  <blockquote>
    <p>syntax error at ./Learning_perl_chapt15.pl line 13, near "){" syntax
    error at ./Learning_perl_chapt15.pl line 15, near "){" syntax error at
    ./Learning_perl_chapt15.pl line 16, near ";}" syntax error at
    ./Learning_perl_chapt15.pl line 17, near ";}" Execution of
    ./Learning_perl_chapt15.pl aborted due to compilation errors.</p>
  </blockquote>