[Melbourne-pm] Bareword found where operator expected

Gary Smith gary at devgurus.com
Mon Feb 17 18:19:01 PST 2014


Ben provided the answer. I just hadn't looked hard enough. My local 
starman was using /usr/bin/perl.

Gary

On 18/02/2014 12:55 pm, Gary Smith wrote:
> Yep - that's what is happening. I have 5.16.3 installed with perlbrew 
> and everything in my environment tells me that it's being used. But 
> when the main script runs it's managing to use the system perl in 
> /usr/bin which is 5.10.
>
> gary at intertradedocs:~$ perl -E 'say join $/, @INC'
> /home/gary/perl5/lib/perl5/x86_64-linux
> /home/gary/perl5/lib/perl5
> /home/gary/perl5/perlbrew/perls/perl-5.16.3/lib/site_perl/5.16.3/x86_64-linux
> /home/gary/perl5/perlbrew/perls/perl-5.16.3/lib/site_perl/5.16.3
> /home/gary/perl5/perlbrew/perls/perl-5.16.3/lib/5.16.3/x86_64-linux
> /home/gary/perl5/perlbrew/perls/perl-5.16.3/lib/5.16.3
> .
> gary at intertradedocs:~$ which perl
> /home/gary/perl5/perlbrew/perls/perl-5.16.3/bin/perl
>
> Gary
>
>
> On 18/02/2014 12:03 pm, Ben Hare wrote:
>> On 17 February 2014 17:33, Myf White<myfwhite at gmail.com>  wrote:
>>> I think the /u modifier for unicode was introduced in 5.14
>>>
>>> Kind Regards,
>>> Myf White
>>>
>>> Email:myfwhite at gmail.com
>>>
>>>
>>> On Mon, Feb 17, 2014 at 5:57 PM, Sam Watkins<sam at nipl.net>  wrote:
>>>> I don't know what your /u
>>>> u modifier is meant to be, but it doesn't work for me and causes that
>>>> error in perl v5.10.
>>>>
>> app using wrong ( older ) perl?
>>
>> Ben.
>>
>>
>>>> So I guess that 'u' modifier is your problem.
>>>>
>>>> Sam
>>>>
>>>> On Mon, Feb 17, 2014 at 11:40:34AM +1100, Gary Smith wrote:
>>>>> Hi All,
>>>>>
>>>>> 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.
>>>>>
>>>>> Perl version is 5.16.3
>>>>>
>>>>> The environment is Catalyst/Pg/Starman.
>>>>>
>>>>> Here is the error output:
>>>>>
>>>>> Bareword found where operator expected at
>>>>> /home/gary/myapp/lib/myapp/Controller/Lookup.pm line 59, near "/^
>>>>> \s* ( [\s\d\w]{3,} ) \s* $/ux"
>>>>>          (Missing operator before ux?)
>>>>> Error while loading /home/gary/myapp/myapp.psgi: syntax error at
>>>>> /home/gary/myapp/lib/myapp/Controller/Lookup.pm line 59, near "/^
>>>>> \s* ( [\s\d\w]{3,} ) \s* $/ux"
>>>>> Can't use global $1 in "my" at
>>>>> /home/gary/myapp/lib/myapp/Controller/Lookup.pm line 60, near "= $1"
>>>>> BEGIN not safe after errors--compilation aborted at
>>>>> /home/gary/myapp/lib/myapp/Controller/Lookup.pm line 73.
>>>>> Compilation failed in require at
>>>>> /home/gary/perl5/lib/perl5/Catalyst/Utils.pm line 308.
>>>>> Compilation failed in require at /home/gary/myapp/myapp.psgi line 4.
>>>>> BEGIN failed--compilation aborted at /home/gary/myapp/myapp.psgi line 4.
>>>>>
>>>>>
>>>>> Here is the relevant code lines 59 & 60 in Lookup.pm:
>>>>>
>>>>>          if ($c->request->params->{$field} =~ /^ \s* ( [\s\d\w]{3,} )
>>>>> \s* $/ux) {
>>>>>              my $value = $1;
>>>>>
>>>>>
>>>>> 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.
>>>>>
>>>>> Regards,
>>>>>
>>>>> Gary
>>>>> _______________________________________________
>>>>> Melbourne-pm mailing list
>>>>> Melbourne-pm at pm.org
>>>>> http://mail.pm.org/mailman/listinfo/melbourne-pm
>>>> _______________________________________________
>>>> Melbourne-pm mailing list
>>>> Melbourne-pm at pm.org
>>>> http://mail.pm.org/mailman/listinfo/melbourne-pm
>>>
>>> _______________________________________________
>>> Melbourne-pm mailing list
>>> Melbourne-pm at pm.org
>>> http://mail.pm.org/mailman/listinfo/melbourne-pm
>>
>
>
>
> _______________________________________________
> Melbourne-pm mailing list
> Melbourne-pm at pm.org
> http://mail.pm.org/mailman/listinfo/melbourne-pm

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/melbourne-pm/attachments/20140218/c93a80ce/attachment-0001.html>


More information about the Melbourne-pm mailing list