in reply to Re^4: How to store an array in the store of Bot::BasicBot::Pluggable::Module?
in thread How to store an array in the store of Bot::BasicBot::Pluggable::Module?

Returning an array works too, you just have to provide list context on the calling side, i.e.

sub x { ... return @f; } my @r= x(...);

would work. You don't need the concatenation

  • Comment on Re^5: How to store an array in the store of Bot::BasicBot::Pluggable::Module?
  • Download Code

Replies are listed 'Best First'.
Re^6: How to store an array in the store of Bot::BasicBot::Pluggable::Module?
by brengo (Acolyte) on Jan 23, 2011 at 02:22 UTC

    I can't provide list context on the calling side though because the "return" of the function is defined/used by the Bot::BasicBot::Pluggable::Module class (or one of it's ancestors) to directly speak to the irc channel. Everything that gets returned should be said in the channel by the bot. Apparently the programmers of that module didn't think of a possible list context case.

    So it was one of my mistakes to assume that array elements (of a returned array) would be printed out (=said in the channel) automatically...