Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!sdd.hp.com!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.lang.perl Subject: Re: Starting editor from within perl script Message-ID: <9610@jpl-devvax.JPL.NASA.GOV> Date: 21 Sep 90 19:22:44 GMT References: <1990Sep21.190641.9221@cs.rochester.edu> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 22 In article <1990Sep21.190641.9221@cs.rochester.edu> roche@cs.rochester.edu (James Roche) writes: : I'm trying to write a replacement for Pnews to handle some special : local requirements. I am having trouble getting an editor to start : from within the perl script. : : I have tried: : `/usr/ucb/vi /tmp/postnews$$`; : : A ps shows that the editor was started, but it doesn't display anything. : I can type input and it all works, but nothing gets displayed. : : What's the trick to starting an interactive program from within a perl : script. Don't use backticks. They eat the stdout of the subprocess. Say this: $EDITOR = $ENV{'VISUAL'} || $ENV{'EDITOR'} || '/usr/ucb/vi'; system "$EDITOR /tmp/postnews$$"; Larry