<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <font size="-1">Hi All,<br>
      <br>
      I'm seeing an error in a file here but I think it may be related
      to the development environment rather than the file. The reason I
      say that is because the error only occurs in the environment that
      I have created (with perlbrew) for myself. The production
      environment doesn't exhibit the same error and I also use this
      same code on a Debian VM without issue.<br>
      <br>
      Perl version is 5.16.3<br>
      <br>
      The environment is Catalyst/Pg/Starman.<br>
      <br>
      Here is the error output:<br>
      <br>
      Bareword found where operator expected at /home/gary/myapp/lib/</font><font
      size="-1"><font size="-1">myapp</font>/Controller/Lookup.pm line
      59, near "/^ \s* ( [\s\d\w]{3,} ) \s* $/ux"<br>
              (Missing operator before ux?)<br>
      Error while loading /home/gary/</font><font size="-1"><font
        size="-1">myapp</font>/</font><font size="-1"><font size="-1">myapp</font>.psgi:
      syntax error at /home/gary/</font><font size="-1"><font size="-1">myapp</font>/lib/</font><font
      size="-1"><font size="-1">myapp</font>/Controller/Lookup.pm line
      59, near "/^ \s* ( [\s\d\w]{3,} ) \s* $/ux"<br>
      Can't use global $1 in "my" at /home/gary/</font><font size="-1"><font
        size="-1">myapp</font>/lib/</font><font size="-1"><font
        size="-1">myapp</font>/Controller/Lookup.pm line 60, near "= $1"<br>
      BEGIN not safe after errors--compilation aborted at /home/gary/</font><font
      size="-1"><font size="-1">myapp</font>/lib/</font><font size="-1"><font
        size="-1">myapp</font>/Controller/Lookup.pm line 73.<br>
      Compilation failed in require at
      /home/gary/perl5/lib/perl5/Catalyst/Utils.pm line 308.<br>
      Compilation failed in require at /home/gary/</font><font size="-1"><font
        size="-1">myapp</font>/</font><font size="-1"><font size="-1">myapp</font>.psgi
      line 4.<br>
      BEGIN failed--compilation aborted at /home/gary/</font><font
      size="-1"><font size="-1">myapp</font>/</font><font size="-1"><font
        size="-1">myapp</font>.psgi line 4.<br>
      <br>
      <br>
      Here is the relevant code lines 59 & 60 in Lookup.pm:<br>
      <br>
              if ($c->request->params->{$field} =~ /^ \s* (
      [\s\d\w]{3,} ) \s* $/ux) {<br>
                  my $value = $1;<br>
      <br>
      <br>
      I know that the code is fine as it has been working fine for many
      months and still works fine on the production and Debian servers.
      I don't know what in my environment would cause the error. It
      appears to be saying that it doesn't like the regex, but there
      doesn't appear to be any syntax issues there.<br>
      <br>
      Regards,<br>
      <br>
      Gary<br>
    </font>
  </body>
</html>