in reply to perl prog to read a sentence and print the count of chars for each word

And your Perl does not complain at the statement

$word = $array $count - 1;
????

BTW, you forgot to set use strict; use warnings; in your program.
-- 
Ronald Fischer <ynnor@mm.st>