constant to use as a portable quote character (see above). However, if you provide an array reference, special rules apply: If your command contains B (< > | &), it will be internally stringified before executing the command, to avoid that these special characters are escaped and passed as arguments instead of retaining their special meaning. However, if the command contained arguments that contained whitespace, stringifying the command would lose the significance of the whitespace. Therefore, C will quote any arguments containing whitespace in your command if the command is passed as an arrayref and contains special characters. =item Whitespace and IPC::Run When using C, if you provide a string as the C argument, the string will be split on whitespace to determine the individual elements of your command. Although this will usually just Do What You Mean, it may break if you have files or commands with whitespace in them. If you do not wish this to happen, you should provide an array reference, where all parts of your command are already separated out. Note however, if there are extra or spurious whitespaces in these parts, the parser or underlying code may not interpret it correctly, and cause an error. Example: The following code gzip -cdf foo.tar.gz | tar -xf - should either be passed as "gzip -cdf foo.tar.gz | tar -xf -" or as ['gzip', '-cdf', 'foo.tar.gz', '|', 'tar', '-xf', '-'] But take care not to pass it as, for example ['gzip -cdf foo.tar.gz', '|', 'tar -xf -'] Since this will lead to issues as described above. =item IO Redirect Currently it is too complicated to parse your command for IO redirections. For capturing STDOUT or STDERR there is a work around however, since you can just inspect your buffers for the contents. =item Interleaving STDOUT/STDERR Neither IPC::Run nor IPC::Open3 can interleave STDOUT and STDERR. For short bursts of output from a program, e.g. this sample, for ( 1..4 ) { $_ % 2 ? print STDOUT $_ : print STDERR $_; } IPC::[Run|Open3] will first read all of STDOUT, then all of STDERR, meaning the output looks like '13' on STDOUT and '24' on STDERR, instead of 1 2 3 4 This has been recorded in L as bug #37532: Unable to interleave STDOUT and STDERR. =back =head1 See Also L, L =head1 ACKNOWLEDGEMENTS Thanks to James Mastros and Martijn van der Streek for their help in getting L to behave nicely. Thanks to Petya Kohts for the C code. =head1 BUG REPORTS Please report bugs or other issues to Ebug-ipc-cmd@rt.cpan.orgE. =head1 AUTHOR Original author: Jos Boumans Ekane@cpan.orgE. Current maintainer: Chris Williams Ebingos@cpan.orgE. =head1 COPYRIGHT This library is free software; you may redistribute and/or modify it under the same terms as Perl itself. =cut