|
|
| Perl-Sensitive Sunglasses | |
| PerlMonks |
Re: Run multiple shell commands on the same perl scriptby Athanasius (Vicar) |
| on Oct 31, 2012 at 02:20 UTC ( #1001590=note: print w/ replies, xml ) | Need Help?? |
|
Hello Daral, and welcome to the Monastery! As 2teez explained, you can use system to run an external command from within a Perl script. But note that system returns the command’s exit status, not its output. If you want to capture the command’s output, use backticks (or the equivalent qx operator):
Update: To capture both the output and the exit status, use the CPAN module Capture::Tiny. Hope that helps, Athanasius <°(((>< contra mundum
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||