in reply to Re^2: Semicolon behaviour in system call
in thread Semicolon behaviour in system call

Indeed... but what's the equivalent in a system call?

system takes a shell command, so the equivalent of

echo "1 & echo 2 & echo 3" & echo two dos & echo t

using system is

system('echo "1 & echo 2 & echo 3" & echo two dos & echo t');

Do you realize you are launching a Windows build of Perl (ActivePerl or Strawberry Perl?), and that Windows build of Perl launch cmd rather than (non-existent) /bin/sh? In other words,

system('pwd; pwd');
is the same as
system('cmd', '/x', '/c', 'pwd; pwd');

Perhaps you are looking for

# Adjust the path for your system system('c:\\progs\\cygwin\\bin\\sh', '-c', 'pwd; pwd');

Replies are listed 'Best First'.
Re^4: Semicolon behaviour in system call
by casual_prgmr (Initiate) on Mar 28, 2014 at 18:16 UTC

    Thank you very much indeed for your analysis, and your code samples, and for the overall illumination provided