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

Can you please tell me why the following line gives me an uncaught exception from user code due to syntax error on this line? $temp = "grep \"synopsys translate_\" *.v | awk -F ":" '{print $1}' | uniq "; Execution of test.pl aborted due to compilation errors.

Replies are listed 'Best First'.
Re: uncaught exception
by Corion (Patriarch) on Jan 31, 2011 at 20:50 UTC

    You have unquoted double quotes in your command. I recommend using the qq{} operator (if variable interpolation is really what you want):

    $temp = qq{grep "synopsys translate_" *.v | awk -F ":" '{print $1}' | +uniq}

    but note that $1 will be interpolated by Perl. If you don't want that either, don't use double quotes. I recommend the q{} operator:

    $temp = q{grep "synopsys translate_" *.v | awk -F ":" '{print $1}' | u +niq}