Boy, was I stupid... Thank you! It works now with the following snippet:
if ( $body =~ /^!setq\s*$/ ) { my @order = ("orange","peach","banana"); $self->set("fruit_order"=>\@order); my $o= $self->get("fruit_order"); my $ou= "order: ".join(", ",@$o); return $ou if (ref $o eq 'ARRAY'); return "no order :("; }
Why it didn't work before, you ask? Well, if you look closely you'll find that I tried to use return with an array. It will not dump the contents of the array into the channel though but expects a scalar (so it sent a 0 for an empty array and a 3 for the above example). I had to use string concatenation and a helper variable first to get return to paste the contents of the array.
Works now, thanks again!
In reply to Re^4: How to store an array in the store of Bot::BasicBot::Pluggable::Module?
by brengo
in thread How to store an array in the store of Bot::BasicBot::Pluggable::Module?
by brengo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |