in reply to perl and Docker
The conf file you are trying to load contains garbage characters.
The relevant code in your external script is:
This is a horrible way of loading configuration, but it works: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; }
$ 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!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: perl and Docker
by shmem (Chancellor) on Oct 31, 2016 at 16:21 UTC |