Keep It Simple, Stupid | |
PerlMonks |
Re^3: Passing commands to subroutinesby repellent (Priest) |
on Jul 03, 2009 at 22:57 UTC ( [id://777136]=note: print w/replies, xml ) | Need Help?? |
Multiple-arg system() doesn't quite work like that (read this). Redirection using the shell metacharacter ">" is handled by the shell, which reads the entire string "program $ref_file > $outfile", parses it, and executes the command with redirection. When you do multiple-arg system, you're going raw and skipping the shell (usually). Redirections have to be performed manually and you'll lose some convenience you get with using a shell. Example:
If you really want a quick-and-dirty fix for your "whitespace-in-filename" problem, place single-quotes around the filenames, as in:
Now make sure you don't have single-quotes in the filenames...
In Section
Seekers of Perl Wisdom
|
|