<?xml version="1.0" encoding="windows-1252"?>
<node id="1004659" title="How to output backtick or qx to a variable and STDOUT at the same time?" created="2012-11-20 00:53:06" updated="2012-11-20 00:53:06">
<type id="115">
perlquestion</type>
<author id="974536">
dr.jekyllandme</author>
<data>
<field name="doctext">
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:

&lt;code&gt;
#!usr/bin/perl

use strict;
use warnings;

my $cmd = qx("ls -l");
print "$cmd";

&lt;/code&gt;

Thank you.</field>
</data>
</node>
