niall munnelly wrote:

>hello - 
>
>i'm not just new to ruby, i'm quite new to programming in general (beyond
>some massively kludgy shell scripts).
>
>i've been rtfming, but haven't found an answer yet, so i'd be most
>appreciative for any gentle nudges in the right direction.
>
>right now i'm working on a little script that will output x number of
>iterations of a user-defined statement.
>
>
>
>print "what comment should i use?\n"
>
>$enterComment = STDIN.gets
>
>        $enterComment.chop!
>
>print "how many iterations do you want?\n"
>
>$enterNumber = STDIN.gets
>
>        $enterNumber.chop!
>
>$total = $randomComment + $enterComment + $protect
>
>print $total * $enterNumber
>  
>
You are using undefined variables ($randomComment, $protect).
In ruby-speak: you are sending the message '+' to nil.
And please get rid of the ugly dollars! This isn't Perl.

Han

>  
>