printf of perl cannot give output properly when input string
contains % symbol. (The problem has been found in 433 and 500)
For example:
input string="%(File)Arg_1% is not a folder."
after using printf,
output string="%(File)Arg_1 0s not a folder."
detailed info:
------test perl script file: perl_test.pl-----------
#!/usr/bin/perl -sw
local($infile, $outfile)=@ARGV;
print"input:$infile;output:$outfile;\n";
open(IN, "$infile"
;
open(OUT, ">$outfile"
;
local($line);
while($line=<IN>){
printf OUT $line;
print "$line";
}
------------end of perl script file --------------------
-------------test file (input file): perl_bug----------
#example of perl bug
#when perl read the following strings, it cannot print out same string
%(File)Arg_1% is not a folder.
--------------end of test file -------------------------
run it.........
./perl_test.pl perl_bug perl_out
get out put file
--------------output file: perl_ouput--------------------
#example of perl bug
#when perl read the following strings, it cannot print out same string
%(File)Arg_1 0s not a folder.
-------------end of output file---------------------------
contains % symbol. (The problem has been found in 433 and 500)
For example:
input string="%(File)Arg_1% is not a folder."
after using printf,
output string="%(File)Arg_1 0s not a folder."
detailed info:
------test perl script file: perl_test.pl-----------
#!/usr/bin/perl -sw
local($infile, $outfile)=@ARGV;
print"input:$infile;output:$outfile;\n";
open(IN, "$infile"
open(OUT, ">$outfile"
local($line);
while($line=<IN>){
printf OUT $line;
print "$line";
}
------------end of perl script file --------------------
-------------test file (input file): perl_bug----------
#example of perl bug
#when perl read the following strings, it cannot print out same string
%(File)Arg_1% is not a folder.
--------------end of test file -------------------------
run it.........
./perl_test.pl perl_bug perl_out
get out put file
--------------output file: perl_ouput--------------------
#example of perl bug
#when perl read the following strings, it cannot print out same string
%(File)Arg_1 0s not a folder.
-------------end of output file---------------------------