svenkata has asked for the wisdom of the Perl Monks concerning the following question:

Hi all, I have a simple piece of code to create Verilog templates using perl where I have to execute something like this: print "module( ... ... $display("The time is %d",$time)\n"; If I try to escape the $ and " I still get a compile error and when I escape even the paranthesis ( then it works Can someone tell me why this is happening when paranthesis is not one of the characters that need to be escaped in a perl string enclosed in "
  • Comment on Question regarding printing Special Characters in perl

Replies are listed 'Best First'.
Re: Question regarding printing Special Characters in perl
by Anonymous Monk on Jan 05, 2013 at 01:28 UTC
Re: Question regarding printing Special Characters in perl
by eyepopslikeamosquito (Archbishop) on Jan 05, 2013 at 01:39 UTC

    Rather than your vague problem description, in future please provide a precise, specific code snippet (embedded in <CODE>...</CODE> tags) of what is not working for you.

    An example of such a specific code snippet is:

    use strict; use warnings; print "module( ... ... \$display(\"The time is %d\",\$time)\n";
    which works for me, printing:
    module( ... ... $display("The time is %d",$time)
    You might consider using single quotes or here documents for this type of thing (see the links provided by anonymonk above for details).

Re: Question regarding printing Special Characters in perl
by Anonymous Monk on Jan 05, 2013 at 02:51 UTC
    Thanks for the Reply.Appreciate it :)