home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!ftpbox!mothost!merlin.dev.cdx.mot.com!fendahl.dev.cdx.mot.com!mcook
- From: mcook@fendahl.dev.cdx.mot.com (Michael Cook)
- Subject: Re: system() vs exec()
- Message-ID: <mcook.724624157@fendahl.dev.cdx.mot.com>
- Sender: news@merlin.dev.cdx.mot.com (USENET News System)
- Nntp-Posting-Host: fendahl.dev.cdx.mot.com
- Organization: Motorola Codex, Canton, Massachusetts
- References: <mcook.724446650@fendahl.dev.cdx.mot.com> <1992Dec16.160845.17636@news.eng.convex.com> <2B30B274.616E@tct.com>
- Date: Thu, 17 Dec 1992 20:29:17 GMT
- Lines: 23
-
- chip@tct.com (Chip Salzenberg) writes:
-
- >According to tchrist@convex.COM (Tom Christiansen):
- >> sub system { fork ? wait : exec @_ }
-
- >What if fork fails? Try instead:
-
- > sub system {
- > local($pid) = fork;
- > return undef unless defined($pid);
- > $pid ? wait : exec @_;
- > }
-
- If you won't grant me that system() is broken, then you must grant me that the
- manpage is broken. That was my point.
-
- Besides, you've used @_ after you used local(). That's a Perl no-no.
-
- Michael.
-
- --
- sub a {local($d); print @_;}
- &a($a="Just ",$b="another ",$c="Perl ",$d="system ",$e="hacker,");
-