I am completely new to Perl. I am trying to build a basic IRC bot.
In the module Bot::BasicBot, what does the line my ($self, $message) = @_; in the “said” function mean?
I do know that my is for private, and @_ is the array for receiving parameters in the function, but how is a hash reference passed here?
Also, how do I access the parameters “who”, “address”, “body”?
Thanks.
Well, these are Perl basics. You should start learning it first before you write bigger programs. If you know programming at all, this shouldn’t take that long. Although I answer your question I really urge you to do it.
@_is indeed for arguments.$selfis the object thesaid()method is called on and$messageis the parameter which indeed is a hash ref according to the documentation. You get the values out of a hash ref via$message->{who}etc.