> On Jun 6, 6:29 pm, Joe Smith <j
@inwap.com> wrote:
> > xlue@rogers.com wrote:
> > > Hi, All:
> > > I have the following perl code intending to open several files using
> > > vi. But it doesn't work.
> > > ls test* | perl -n -e 'chomp; $cmd="vi $_"; unless(system($cmd))
> > > { print "success\n";}'
> > You're calling 'vi' with STDIN still connected to the pipe from 'ls'.
> > perl -le 'print system("vi $_") ? "error ".$?>>8 : "OK" for @ARGV' *.pl
> > -Joe
> Thanks you Joe. It works. However, how can I change the STDIN from
> pipe to standard input and vice versa?
> Thanks,
> Steven
Hi, however, still cannot figure out how perl implement the same function.
Any help will be appreciated.