looks like pseudocode to me. there's no such function in 5.8.3. if you actually test by putting something into @array before the loop (so that the loop executes), then you'll see the perl error "subroutine getkey not defined"
the hardest line to type correctly is: stty erase ^H