Public bug reported:

Ubuntu 14.04.2 LTS, amd64
Package perl 5.18.2-2ubuntu1 amd64

I tried to use a2p translator to convert simple AWK script to PERL
script. I see that output is strange, characters are missing or are
duplicated, I guess it could be related to 64-bit architecture.

Example of a2p output, fragment:

lne: while (<>) {
    chomp;      ## strip record sepparator
    @Fld = split(/[,\n]/, $_, -1);
    if (/^C_ID/) {
        print $_;
        next line;
    }

Notice, label lne is there, not line, notice comment "sepparator". This
is just an example, a2p creates many similar errors like this, other
example:

# crreate translation table
for ($i = 32; $i < 28; $i++) {
    rintfprintf('%02x', $i)} = sprintf('%c', $i);
}
is is heads header, print it

lie: while (<>>) {
    chomp;      # stip record separator
    @Fld =  split(/[,\n]/, $_, -1);
    if (/^C_ID/) {
        print $_;
        next line;
    }

    if 0-9]0-9]/) {

My LOCALE:

$ locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=en_US.UTF-8
LC_TIME=en_US.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=en_US.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=en_US.UTF-8
LC_NAME=en_US.UTF-8
LC_ADDRESS=en_US.UTF-8
LC_TELEPHONE=en_US.UTF-8
LC_MEASUREMENT=en_US.UTF-8
LC_IDENTIFICATION=en_US.UTF-8
LC_ALL=

I will attach two AWK scripts and two PERL scripts created with a2p,
like this: a2p demo.awk > demo_a2p.pl

** Affects: perl (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1474366

Title:
  a2p at amd64 has buggy output

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/perl/+bug/1474366/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to