develooper Front page | perl.perl5.porters | Postings from September 2013

[perl #119459] Compilation error at /usr/share/perl/5.14/utf8_heavy.pl line 447

Thread Next
From:
Father Chrysostomos via RT
Date:
September 17, 2013 05:04
Subject:
[perl #119459] Compilation error at /usr/share/perl/5.14/utf8_heavy.pl line 447
Message ID:
rt-3.6.HEAD-1873-1379394283-50.119459-15-0@perl.org
On Sun Aug 25 08:30:00 2013, thetaworld@gmail.com wrote:
> -----------------------------------------------------------------
> [Please describe your issue here]
> 
> There must be error in core of Perl. I do have 7500 lines in the
> script. However, even a slightest change, like missing colon or
>    ampersand
> or syntax error may lead to following:
> 
> Compilation error at /usr/share/perl/5.14/utf8_heavy.pl line 447.
> 
> And that is not what should happen.
> 
> Even just checking the syntax with perl -c script.pl gives above error
> message. It becomes impossible to know what is wrong in the script.
>    One
> has to go manualy and search for the syntax error as perl does not
>    tell
> what was the real error message.

You may be running into bug #99984, which was fixed in perl 5.16 in
commit ba6ff154b0d8.  Could you try your script with perl 5.16 (or 5.18)?

If you are stuck with 5.14, read on.

As Brian Fraser suggested in ticket #99984, you can work around the
problem by preloading swashes explicitly via

    BEGIN { "\x{100}" =~ /[\p{XIdStart}]/ }

to load the XIdStart swash, for example.

You can find out which swash utf8_heavy.pl was trying to load when it
croaked by patching it in-place like this:

--- /usr/local/lib/perl5/5.14.4/utf8_heavy.pl	2013-09-16
22:01:26.000000000 -0700
+++ /tmp/foo	2013-09-16 22:01:21.000000000 -0700
@@ -444,7 +444,7 @@ sub croak { require Carp; Carp::croak(@_
 
                 local $@;
                 local $!;
-                $list = do $file; die $@ if $@;
+                $list = do $file; die "$type: $@" if $@;
             }
 
             $ListSorted = 1; ## we know that these lists are sorted

With that applied, this (the test case from #99984):

perl5.14.4 -Mutf8 -Ilib -lwe 'use strict; eval q "our $::é; $é"; print $@'

gives me this:

XIdStart: Compilation error at /usr/local/lib/perl5/5.14.4/utf8_heavy.pl
line 447.

Preloading XIdStart unhides the error:

$ perl5.14.4 -Mutf8 -Ilib -lwe 'BEGIN { "\x{100}" =~ /[\p{XIdStart}]/ };
use strict; eval q "our $::é; $é"; print $@'
Variable "$é" is not imported at (eval 1) line 2.
No package name allowed for variable $::é in "our" at (eval 1) line 1,
near "our $::é"
Can't use global $::é in "my" at (eval 1) line 1, near "our $::é"
Global symbol "$?" requires explicit package name at (eval 1) line 2.


Now, this is all assuming that the two bugs are the same.  Could you try
such an approach with your 7500-line script and see if that helps? 

-- 

Father Chrysostomos


---
via perlbug:  queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=119459

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About