System call doesn't work



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";}'


it reports error like:
"Input read error
success
"


Thanks for your help.


Steven

.