On Tue, 2 Jul 2002, Poonam P wrote:

> I need to capture the numeric value of qmail-qstat in some variable
> and process it further in a Perl Shell Scrip.

umm, what is qmail-qstat and what do you mean by value?

anyway, there are two ways to capture the `value' of a program in perl - 
depending on what you mean by value.

if you meant the output of the program, then do this:

my $output = `qmail-qstat`;     # you may have to give the full path.

if you meant the return value, then do this:

system "qmail-qstat";
my $output = $?<<8;

of course, read man perlvar to fully understand what $? is and how to 
use it correctly.  What I've given above is by no means complete, you 
*must* read the man pages to complete it.

man perlvar - for $?
man perlop  - for ``
perldoc -f system - for system

-- 
The last thing one knows in constructing a work is what to put first.
-- Blaise Pascal

_______________________________________________
http://mm.ilug-bom.org.in/mailman/listinfo/linuxers

Reply via email to