in reply to Probably an easy one - store command in variable.
Now if you wanted the array from $d->checklist() to return as a reference itself you might try.my $command = sub { my @returnstring = $d->checklist( text => $text, list => [ @list ] + ); return \@returnstring; }; my $some_ref = &$command;
However if you already have declared @returnstring outside of the scope of your anonymous sub and you wish to use this sub to modify it then you could simply do something like this...my $command = sub { my $returnstring = \($d->checklist( text => $text, list => [ @list + ] )); return $returnstring; }; my $some_ref = &$command;
again assuming that $d->checklist() returns an array.my @returnstring; my $command = sub { @returnstring = $d->checklist( text => $text, list => [ @list ] ); };
|
|---|