in reply to Strict Usage

Where you have
%words = qw ( fred camel barney llama betty alpaca wilma alpaca );
That should be
my %words = qw ( fred camel barney llama betty alpaca wilma alpaca );
my declares a variable to be a lexical, which means "non-global". You have to declare all your variables the first time you use it to be 'strict', so to speak.

------
/me wants to be the brightest bulb in the chandelier!

Vote paco for President!

Replies are listed 'Best First'.
Re (tilly) 2: Strict Usage
by tilly (Archbishop) on Aug 22, 2001 at 17:27 UTC
    Lexical does not mean "non-global". As Dominus points out at Re: (s)coping with foreach, it means "pertaining to the text".

    Also note that when trying to import variables from other modules you should declare with the vars pragma rather than with my.

    For more on scoping I recommend Coping with Scoping by Dominus. It predates "our", but then again I don't like our much.