in reply to Re: Syntax details with "system"
in thread Syntax details with "system"

Thanks Arnon. That answer was useful. I suspect the 1st form works because of the specifics here (qrsh is a Sun Grid Engine command which opens a shell on a node and runs "lens ... 2>$logfile"). I didn't realize it made a difference for the answer.

I finally found out what characters exactly needed to be escaped how many times

system "qrsh $qrsh_options \"lens -n \\\"source $qscript ; test_model +$arguments\\\" >$output_file 2>$logfile\"";
I just read about quotemeta and I suspect it wouldn't work for me because all the $ would be escaped and the perl variables wouldn't be resolved. But I will remember \Q...\E for the future - I'm sure it will come in handy sometime :-)