in reply to Re^2: How to call Linux command sequentially
in thread How to call Linux command sequentially
When you call exec a new process is forked and the parent quits, whereas when you call system the parent waits for the system call to complete. Using backticks `` or the qx is similar to a system call but the output is returned to the caller. eg.
Could you show us how you call the command within your Perl script?$ perl -Mstrict -e 'my @out =qx{ls $ENV{HOME}/tmp}; chomp @out; print join (", " , @out), "\n";' a.out, test.c, test.dat, test.pl
print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: How to call Linux command sequentially
by mv.ashwin@gmail.com (Novice) on Sep 13, 2011 at 09:22 UTC | |
by Corion (Patriarch) on Sep 13, 2011 at 09:25 UTC | |
by graff (Chancellor) on Sep 13, 2011 at 09:33 UTC |
In Section
Seekers of Perl Wisdom