title: How do I fix Perl Getopt::Long event not found error?
body: <p>I am using <code>Getpt::Long</code> to take the arguments from the command line and assign them to their respective variables. But, I am getting errors when I am printing it. The code and the error is as follows:</p>
  
  <pre><code>#!usr/bin/perl
  
  use strict;
  use warnings;
  use Getopt::Long;
  
  GetOptions(
      "mount_path=s" =&gt; \my $old_path,
      "var=s"        =&gt; \my $var,
      "log_path=s"   =&gt; \my $log_path,
  ) or die "Error in input variables\n";
  
  print &lt;&lt;"END_INPUTS";
   These are your inputs: 
   old_path= $old_path 
   var = $var 
   log_path=$log_path 
   Press enter twice if all looks GOOD 
   *********************************************************
  END_INPUTS
  </code></pre>
  
  <p>The command line arguments are as follows:</p>
  
  <pre><code> perl getvar.pl --mount_path=/var/sslvpn --var=7.0.0.2_va-SSLVPN-!7.0.0.2.16sv+.jpn-05!j+g_554863- --log_path=log.txt  
  </code></pre>
  
  <p>I am getting the following error while running this </p>
  
  <pre><code>-bash: !7: event not found
  </code></pre>