I have a Perl script which should run on Windows, Linux or proprietary Unix systems (subject to the proprietary OS vendors providing a moderately current Perl environment!).
I am building a command ARRAY comprising the command name followed by a series of -keyword value pairs:
@cmd = (@cmd, "-key1", "value", "-key2", "value2");
This process works happily when I run it on Windows (10, Server 2012) and on Linux (CentOS 7) UNLESS one of the values is blank (a literal space character). If I code
@cmd = (@cmd, "-key1", " ", "-key2", "value2");
Windows handles this correctly and passes the space as the value of key1 but Linux attempts to pass "-key2" as the value of key1 and the invoked command suffers fatal conniptions!
If I place single or double quotes around the space character, both platforms object to receiving "' '" since the application expects either an X or a space (without enclosing quotation marks).
When I copy the failing command line to the Linux shell prompt it fails unless I manually insert a pair of quotes around the space character.
Can anybody advise on how to pass an unquoted space character via ipc::run3 please?
In reply to ipc::run3 portability by murrayn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |