home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!convex!convex!tchrist
- From: Tom Christiansen <tchrist@convex.COM>
- Subject: Re: What's the difference between `command` and system('command')?
- Originator: tchrist@pixel.convex.com
- Sender: usenet@news.eng.convex.com (news access account)
- Message-ID: <1992Sep10.183530.21405@news.eng.convex.com>
- Date: Thu, 10 Sep 1992 18:35:30 GMT
- Reply-To: tchrist@convex.COM (Tom Christiansen)
- References: <sasswb.716131013@k2>
- Nntp-Posting-Host: pixel.convex.com
- Organization: Convex Computer Corporation, Colorado Springs, CO
- X-Disclaimer: This message was written by a user at CONVEX Computer
- Corp. The opinions expressed are those of the user and
- not necessarily those of CONVEX.
- Lines: 33
-
- From the keyboard of sasswb@unx.sas.com (Scott Bass):
- :Sorry for the basic question, but I couldn't find this in the Camel book.
-
- It won't be covered in the book. The source code has to be useful for
- something, after all... :-)
- --Larry Wall in <10160@jpl-devvax.JPL.NASA.GOV>
-
- :What the difference between saying `some Unix command` and
- :system('some Unix command')? Are they synonymous? Are there situations
- :where one is better than the other?
-
- `cmd`;
- $line = `cmd`;
- @lines = `cmd`;
-
- returns the output, as it does in the shell. The first form,
- however, throws it away. system() works much (although not
- quite exactly) as it does in C.
-
- :Finally, what I need to do is export the DISPLAY variable from a PERL
- :script that's submitted via cron. I was just going to give the
- :"export DISPLAY=value" (ksh) command. If there is a better PERL way of
- :doing it, please let me know.
-
- $ENV{DISPLAY} = $value;
- system $cmd;
-
- --tom
- --
- Tom Christiansen tchrist@convex.com convex!tchrist
- As the trials of life continue to take their toll, remember that there
- is always a future in Computer Maintenance.
- -- National Lampoon, "Deteriorada"
-