in reply to quoting issue with system command
You put $contig inside of single tick quotes, and that won't interpolate.
Meanwhile, you wrote ">".$maid_dir."\\".$maid."_aln.out" where you didn't interpolate where a Perl programmer normally would, even though you were using double-tick quotes! For comparison, ">$maid_dir\\${maid}_aln.out" (notice how the last one was handled since it was immediately followed by a character allowed in an identifier).
Meanwhile, use the 3-argument form of open. Don't concatenate the ">" with the name, but keep it as a separate argument. But, as another poster mentioned, passing the open file, stringified (whatever that does) to the blastall.exe command line doesn't make sense. You meant to pass the file name.
Note the use of qq(...) instead of double-tick quotes, so I could use " characters inside the string without escaping them. That's probably why you used single-quotes there in the first place.my $outfile= "$maid_dir\\${maid}_aln.out"; my $command= qq(c:\\blast\\bin\\blastall -p blastn -d "$hu_seq $hd_seq +" -i $contig +-o $alignment);
I do like how you composed the command string separately to using it in the system command, so you could easily see what the command was.
I don't know why you are putting quotes around the two file names together with a space in between, instead of quoting each file name individually. Something about that blastall.exe I suppose, if that's correct. But beware of $maid_dir containing spaces.
—John
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: quoting issue with system command
by lomSpace (Scribe) on May 13, 2009 at 15:42 UTC | |
by John M. Dlugosz (Monsignor) on May 13, 2009 at 16:02 UTC | |
by lomSpace (Scribe) on May 13, 2009 at 17:46 UTC | |
by ikegami (Patriarch) on May 13, 2009 at 18:14 UTC | |
by John M. Dlugosz (Monsignor) on May 13, 2009 at 20:26 UTC | |
by lomSpace (Scribe) on May 13, 2009 at 18:04 UTC |