in reply to NEwbie needs help

Change '@words' in the first line to '%words'. I did this with your code and it started working.

It's a common mistake, one I make all the time (also with arrays) so I keep a copy of the Perl CD bookshelf handy whenever I'm coding.

Chumley

Replies are listed 'Best First'.
Re: Re: Newbie needs help
by greenFox (Vicar) on Mar 26, 2001 at 08:41 UTC
    I wondered if this was an errata or a typo and I thought it might be worth noting that you can find the errata for all O'Reilly books on their web site, here for the Llama book and this example is in the sample chapter.
    -w and use strict will pick up most of those typos for you :)

    --
    my $chainsaw = 'Perl';