in reply to Re: 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?
Thanks for your reply. I made that line up and you're right - it would lead to an array reference. Sadly though, this wasn't the problem. Both of the following snippets don't work, they both return 0:
if ( $body =~ /^!seto\s*$/ ) { my @order = ("pea","plum","banana"); $self->set("fruit_order"=>@order); my @o = @{ $self->get("fruit_order") || [] }; return @o; } if ( $body =~ /^!seto\s*$/ ) { my @order = ("pea","plum","banana"); $self->set("fruit_order"=>\@order); my @o = @{ $self->get("fruit_order") || [] }; return @o; }
As I digged a bit deeper into the according modules I couldn't find any example of an array being stored and retreived. Could it be possible that storing arrays is not supported by the module?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How to store an array in the store of Bot::BasicBot::Pluggable::Module?
by jethro (Monsignor) on Jan 22, 2011 at 10:09 UTC | |
by brengo (Acolyte) on Jan 22, 2011 at 17:21 UTC | |
by jethro (Monsignor) on Jan 22, 2011 at 17:34 UTC | |
by brengo (Acolyte) on Jan 23, 2011 at 02:22 UTC |