Path: utzoo!attcan!uunet!snorkelwacker!tut.cis.ohio-state.edu!usenet.ins.cwru.edu!ncoast!allbery From: allbery@NCoast.ORG (Brandon S. Allbery KB8JRR/KT) Newsgroups: comp.lang.perl Subject: Re: Starting editor from within perl script Message-ID: <1990Sep22.144126.21099@NCoast.ORG> Date: 22 Sep 90 14:41:26 GMT References: <1990Sep21.190641.9221@cs.rochester.edu> Reply-To: allbery@ncoast.ORG (Brandon S. Allbery KB8JRR/KT) Followup-To: comp.lang.perl Organization: North Coast Public Access *NIX, Cleveland, OH Lines: 28 As quoted from <1990Sep21.190641.9221@cs.rochester.edu> by roche@cs.rochester.edu (James Roche): +--------------- | 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$$`; +--------------- The whole point of `` is that, as in a shell, the standard output and standard error of the program are trapped and returned to Perl as a (very large...) string (or list, depending on context). Try the following instead: system '/usr/ucb/vi', "/tmp/postnews$$"; (Splitting it up like that means that the overhead of a shell is unnecessary, but you *must* use a full pathname for the editor. Use a single string if you can't guarantee the existence of a full pathname.) ++Brandon -- Me: Brandon S. Allbery VHF/UHF: KB8JRR/KT on 220, 2m, 440 Internet: allbery@NCoast.ORG Packet: KB8JRR @ WA8BXN America OnLine: KB8JRR AMPR: KB8JRR.AmPR.ORG [44.70.4.88] uunet!usenet.ins.cwru.edu!ncoast!allbery Delphi: ALLBERY