in reply to grep and arrays

As a variation on what FunkyMonk said, did you run the program and see what it did? Did you look at the Perl documentation on grep?