home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!portal!lll-winken!fnnews.fnal.gov!mp.cs.niu.edu!ux1.cso.uiuc.edu!news.cso.uiuc.edu!chappell
- From: chappell@symcom.math.uiuc.edu (Glenn Chappell)
- Newsgroups: comp.lang.perl
- Subject: Re: Calling a text editor from Perl
- Message-ID: <BxvEyu.585@news.cso.uiuc.edu>
- Date: 17 Nov 92 17:23:14 GMT
- References: <Bxtyon.H0x@cs.uiuc.edu>
- Sender: usenet@news.cso.uiuc.edu (Net Noise owner)
- Reply-To: chappell@math.uiuc.edu (Glenn Chappell)
- Organization: Math Dept., University of Illinois at Urbana/Champaign
- Lines: 21
-
- In article <Bxtyon.H0x@cs.uiuc.edu> schwager@cs.uiuc.edu writes:
- >
- >Hi,
- >Is it possible to call a text editor from Perl? I want to do something
- >like this:
- > `/usr/ucb/vi /tmp/addgr$$`;
- >but it looks like the terminal i/o is not working properly, so it just
- >hangs at that statement. Afterwards I have to reset my terminal, so I'm sure
- >it's scrogged somehow. Thanks for any help. I'd hate to have to go back to
- >using csh.
- >
- >I'm on a Sun Sparc, running os 4.1.2, and the latest Perl.
-
- I had (what I think is) the same problem. It turned out to be because vi
- was taking its input from the STDIN of the Perl script, and not from the
- terminal. My solution was to tell it to get its input from /dev/tty,
- e.g.
-
- system "/usr/ucb/vi /tmp/addgr$$ < /dev/tty";
-
- GGC <><
-