readey has asked for the wisdom of the Perl Monks concerning the following question:

Benevolent Monks, Thanks to the monks that replied to my query about how to get perl to recognise that pppd was running on my Linux box. As we all know TIMTOWTDI and I got three completely different approaches. Nice one. I did however try my own way (after thinking awhile) and I came up qwith this so I thought I'd share it. After getting pppd running i tried;
perl -e 'if(system("pppd")) { print "it worked\n";}'
and guess what........ it worked. readey

Replies are listed 'Best First'.
Re: Gettin System Info
by tachyon (Chancellor) on Jul 04, 2001 at 19:05 UTC

    Forgive me if I'm wrong but doesn't this execute 'pppd' via the system call and then print "it worked\n" if we succeed and start a new process?

    cheers

    tachyon

    s&&rsenoyhcatreve&&&s&n\w+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

      Never thought of that one. I shall have another go and see if I get two pppd deamons running. The fact that I'm asking if pppd exists makes me believe that I have only queried it's existance. regards readey
      I tried the same program without pppd running or so I thought. It returned - IT WORKED, so I did a ps -A and there was no sign of pppd. trying the same script with "pon", I got nothing at first because (as you said), perl starts pon itself. readey