Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to use the "got_names" sub, since I want a list of the users in the IRC chat.

But I've been struggling with how I'm actually going to get the names.

My current code:

sub got_names { my $self = shift; my $arguments = shift; my $users = $arguments->{names}; print "$users\n"; }
I think the names are in $arguments, but I just don't know how to access them...

Can't link to the manual page since it gets detected as spam, but Bot::BasicBot is what I'm using.

Replies are listed 'Best First'.
Re: Anyone used Bot::BasicBot before?
by Corion (Patriarch) on Dec 20, 2017 at 11:01 UTC

    You should be able to use [mod://Bot::BasicBot] to link to Bot::BasicBot.

    When I need to deal with a data structure that I don't know, using Data::Dumper is usually quite convenient:

    use Data::Dumper; print Dumper $arguments;

    I'll just assume that $arguments contains an array reference. For accessing that, see tye's References Quick Reference.

      Ah, thanks! Useful stuff.

      $arguments did contains the names, but only the name of the bot. So there might be some deeper problem here...