[Melbourne-pm] Bareword found where operator expected

Ben Hare benhare at gmail.com
Mon Feb 17 17:03:08 PST 2014


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



-- 
Benjamin J. Hare
Web Design, Software & Hosting Solutions
ABN: 22-48-55-71-887
Phone: +61-415-607-197
Web: http://www.benhare.com
Email: ben at benhare.com


More information about the Melbourne-pm mailing list