Use backticks to capture STDOUT from the program.
my $captured=`/sbin/ifconfig ppp01`;
Several other modules are also well suited to the purpose, for example, the
IPC::Open series. By the way, you should familiarize yourself with the differences bewteen
fork,
exec, and
system. The
exec above completely nukes your program and runs ifconfig instead at that point it is called.
AgentM Systems nor Nasca Enterprises nor
Bone::Easy nor Macperl is responsible for the
comments made by
AgentM. Remember, you can build any logical system with NOR.