in reply to perl and Docker

Line 6 of your config file contains garbage (Python's "u"-prefix for unicode strings is foreign to Perl)

Replies are listed 'Best First'.
Re^2: perl and Docker
by IAperl (Initiate) on Nov 01, 2016 at 05:46 UTC

    Hi

    I belive so too that, python is setting the 'conf_file' to unicode.

    As a result, I set the locale of my Docker container to UTF-8, as follows ,

    RUN locale-gen en_US.UTF-8 ENV LC_ALL=en_US.UTF-8 ENV LANG=en_US.UTF-8 ENV LANGUAGE=en_US.UTF-8

    Which changes the container environment as such,

    "Env": [ "PATH=/opt/python-code/extra-scripts:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "LC_ALL=en_AU.UTF-8", "LANG=en_AU.UTF-8", "LANGUAGE=en_AU.UTF-8", "PYTHONPATH=/opt/python-code", "PERL5LIB=/usr/local/perl" ],

    I also include the following in my Dockerfile

    ENV PERL_UNICODE "SD"

    I was of the belief that this would enable perl to read the unicode

    But on running, it still generates the same error.

    I am using python 2.7.12 and perl 5.22

    Cheers

      Enabling unicode for Perl doesn't make Perl able to read Python unicode notation.

      ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

      Hi IAperl,

      Unicode has nothing to do with this. As various monks have told you numerous times, the file is simply not in Perl syntax. Also, I don't think you've posted an example of the file you're actually trying to load, have you? (I didn't dig through all of the GitHub repos you posted.) I know what I mean. Why don't you?

      If the file is in Python syntax, and you want to read it in Perl, then I would suggest that you write a Python script that reads the file and outputs it in a format that both Python and Perl can understand, such as YAML or JSON.

      If the file is supposed to be in Perl syntax, then apparently whoever is generating the file is doing so incorrectly, and I suggest you fix that code. Otherwise, you'd have to code a solution that can read it, which is IMO not the best solution.

      To assist you further, we'll have to see the problem for ourselves - please post an example of the file you are trying to read. How do I post a question effectively?

      Regards,
      -- Hauke D