ios - Getting syntax error in perl script -
i trying run script see in answer:
best way add license section ios settings bundle
and getting syntax error in xcode.
missing right curly or square bracket @ ./acknowledgements.pl line 57, @ end of line syntax error @ ./acknowledgements.pl line 57, @ eof execution of ./acknowledgements.pl aborted due compilation errors. command /bin/sh failed exit code 255
not sure why happening.
here script machine:
#!/usr/bin/perl -w use strict; $out = "../settings.bundle/en.lproj/acknowledgements.strings"; $plistout = "../settings.bundle/acknowledgements.plist"; unlink $out; open(my $outfh, '>', $out) or die $!; open(my $plistfh, '>', $plistout) or die $!; print $plistfh <<'eod'; <?xml version="1.0" encoding="utf-8"?> <!doctype plist public "-//apple//dtd plist 1.0//en" "http://www.apple.com/dtds/propertylist-1.0.dtd"> <plist version="1.0"> <dict> <key>stringstable</key> <string>acknowledgements</string> <key>preferencespecifiers</key> <array> eod $i (sort glob("*.license")){ $value=`cat $i`; $value =~ s/\r//g; $value =~ s/\n/\r/g; $value =~ s/[ \t]+\r/\r/g; $value =~ s/\"/\'/g; $key=$i; $key =~ s/\.license$//; $cnt = 1; $keynum = $key; $str (split /\r\r/, $value){ print $plistfh <<"eod"; <dict> <key>type</key> <string>psgroupspecifier</string> <key>footertext</key> <string>$keynum</string> </dict> eod print $outfh "\"$keynum\" = \"$str\";\n"; $keynum = $key.(++$cnt); } } print $plistfh <<'eod'; </array> </dict> </plist> eod close($outfh); close($plistfh);
i believe heredoc terminator (eod) cannot preceded whitespace. remove indentation , try again.
Comments
Post a Comment