The conf file you are trying to load contains garbage characters.

The relevant code in your external script is:

my(@conf); if(defined($opt{config_file})){ my($buf); $buf = `cat $opt{config_file}`; # slurp if (eval($buf)){ print STDOUT "$me: Read config from $opt{config_file}\n" if $opt +{verbose}; } else{ die "$me: Error reading config from $opt{config_file} (fix it!)\ +n\n"; } } else{ @conf = @default_conf; }
This is a horrible way of loading configuration, but it works:

$ cat 1174639.conf @conf = ( {'step' => 8, 'blur_fwhm' => 4, 'iterations' => 20}, {'step' => 6, 'blur_fwhm' => 3, 'iterations' => 20}, {'step' => 4, 'blur_fwhm' => 2, 'iterations' => 10}, {'step' => 2, 'blur_fwhm' => 1, 'iterations' => 10}, );
$ cat 1174639.pl use strict; use warnings; use feature 'say'; use Data::Dumper; my $file = '1174639.conf'; my $buf = `cat $file`; my @conf; eval( $buf ); say Dumper \@conf;
$ perl 1174639.pl $VAR1 = [ { 'blur_fwhm' => 4, 'step' => 8, 'iterations' => 20 }, { 'step' => 6, 'blur_fwhm' => 3, 'iterations' => 20 }, { 'blur_fwhm' => 2, 'step' => 4, 'iterations' => 10 }, { 'blur_fwhm' => 1, 'step' => 2, 'iterations' => 10 } ];

Do you think this is due to compatibility issue between Perl version 1.2.0 and Perl version 5.0

Definitely not. The 1.2.0 version number you cite is just the version number of the Nlpfit software.

Hope this helps!

The way forward always starts with a minimal test.

In reply to Re: perl and Docker by 1nickt
in thread perl and Docker by IAperl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.