What's happening I think is that merlyn was giving you an example of the usage of the UNIX system command grep. grep() in Perl is different: the syntax is:
grep PATTERN, LIST
or
grep BLOCK LIST
You'll have to write the returned array to file yourself, because grep() doesn't support redirection (as does any Perl function...)
-- my @words = grep({ref} @clever); sub version { print "I cuss your capitalist pig tendencies bad!\n" }