dr.jekyllandme has asked for the wisdom of the Perl Monks concerning the following question:
Hello,
I have a program that issues some system calls. I would like to do 2 things in my function - The system call's output should be stored in a variable and also output to STDOUT.
I guess I am asking for a way to combine both system and qx( backtick ). Is this even possible?
Here is a snapshot of my code:
Thank you.#!usr/bin/perl use strict; use warnings; my $cmd = qx("ls -l"); print "$cmd";
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: How to output backtick or qx to a variable and STDOUT at the same time?
by Athanasius (Archbishop) on Nov 20, 2012 at 06:03 UTC | |
by dr.jekyllandme (Sexton) on Nov 20, 2012 at 06:43 UTC | |
Re: How to output backtick or qx to a variable and STDOUT at the same time?
by Utilitarian (Vicar) on Nov 20, 2012 at 08:39 UTC | |
Re: How to output backtick or qx to a variable and STDOUT at the same time?
by space_monk (Chaplain) on Nov 20, 2012 at 08:36 UTC |
Back to
Seekers of Perl Wisdom