Hi,  I have a line read in perl from a file that itself is a source
code for languages like c/sv etc. The variable containing this line
contains special characters like %d. When i print this line to another
file, the %d is evaluated and a 0 is getting printed. How do i
overcome this and tell perl to strictly not interpolate/evaluate any
contents of this variable and simply print it as is !
~Pushkar

open RFH "< File1.txt";
open WFH "> File2.txt";

while ($line = <RFH>)
{
      chop($line);
      printf WFH "$line\n";
}

File1.txt :
ovm_report_info("DBG_INFO", $psprintf("Programming Bank %d Reg %d", (i/
32), l_uint_reg_num), OVM_HIGH);

File2.txt
ovm_report_info("DBG_INFO", $psprintf("Programming Bank 0 Reg 0", (i/
32), l_uint_reg_num), OVM_HIGH);


-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to