casual_prgmr has asked for the wisdom of the Perl Monks concerning the following question:
perl -e 'system("echo 1; echo 2; echo 3");'
produces the following output on Windows:
1; echo 2; echo 3
The above is consistently produced with ActiveState (have also produced with Oracle's PERL distrib). Only MKS PERL seems to produce the output which I was expecting, i.e.
1 2 3
I also tried:
perl -e 'system("echo 1 && echo 2 && echo 3");'
resulting in:
1 && echo 2 && echo 3
where am I screwing up? Version info:
ActiveState PERL is v5.6.1, Oracle PERL is v5.14.1, MKS PERL is v5.8.5
thanks!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Semicolon behaviour in system call
by AnomalousMonk (Archbishop) on Mar 27, 2014 at 17:56 UTC | |
by casual_prgmr (Initiate) on Mar 27, 2014 at 19:02 UTC | |
by ikegami (Patriarch) on Mar 27, 2014 at 19:50 UTC | |
by casual_prgmr (Initiate) on Mar 28, 2014 at 18:16 UTC | |
by kcott (Archbishop) on Mar 27, 2014 at 19:33 UTC | |
by casual_prgmr (Initiate) on Mar 28, 2014 at 17:34 UTC | |
by ikegami (Patriarch) on Mar 28, 2014 at 17:42 UTC |