in reply to Re: Probably an easy one - store command in variable.
in thread Probably an easy one - store command in variable.

expanding on the anonymous subroutine: you'd need something similar to this:
my @list = qw(some random values); my $text = "bla bla bla"; my $command = sub { $d->checklist( text => $text, list => \@list ); }; my @returnlist = $command->();
In this example $command is a closure - it "captures" the $text and @list variables. Depending on your problem that might or might not be the most elegant solution - without any context, it looks like you could also make a "normal" subroutine and pass those variables to it. YMMV.