2021年4月22日星期四

makepp:Unable to execute perl code in makepp

i am trying to merge two yml files into one file using below perl code:

use strict;  use warnings FATAL => qw(all);  use Hash::Merge qw( merge );  Hash::Merge::set_behavior('RETAINMENT_PRECEDENT');  use YAML::XS qw(Load Dump);  use File::Slurp qw(read_file write_file append_file);  sub f_merge_yml{   my ( $chip_yml, $litter_yml)  = split(' ',$_[0]);   my $in_yml = read_file($chip_yml, { binmode => ':raw' });   my $Load_test_yml = Load $in_yml ;   my $in_yml1 = read_file($litter_yml, { binmode => ':raw' });   my $Load_test1_yml = Load $in_yml1;   my $combined_yml = merge($Load_test_yml, $Load_test1_yml);   my $out_yml = Dump $combined_yml;   my $outFile = "tst_request.yml";   write_file($outFile, { binmode => ':raw' }, $out_yml);   return $outFile;  }  

When i run the code as a perl script it works fine. But when I try to run the same in makepp where we use above code in perl_begin , perl_end constructs as follows:

perl_begin   [...Above code...]  perl_end  

it fails with following error:

makepp: warning: Odd number of elements in hash assignment at /home/utils/perl-5.10/5.10.1-nothreads-64/lib/site_perl/5.10.1/File/Slurp.pm line 75.  

Do i need to make any changes in the script to support makepp run?

https://stackoverflow.com/questions/67223879/makeppunable-to-execute-perl-code-in-makepp April 23, 2021 at 12:06PM

没有评论:

发表评论