my $command = sub { \@returnstring = \$d->checklist( text => $text, list => [ @list ] ) }; &$command; #### Can't modify reference constructor in scalar assignment at ./cdialog.pl line 43, near ") }" Execution of ./cdialog.pl aborted due to compilation errors (#1) (F) You aren't allowed to assign to the item indicated, or otherwise try to change it, such as with an auto-increment. Uncaught exception from user code: Can't modify reference constructor in scalar assignment at ./cdialog.pl line 43, near ") }" Execution of ./cdialog.pl aborted due to compilation errors. #### my $command = sub { $d->checklist( text => $text, list => [ @list ] ); }; my @returnlist = $command->(); #### Can't use string (",") as an ARRAY ref while "strict refs" in use at /usr/local/lib/perl5/site_perl/5.8.3/UI/Dialog/Backend/CDialog.pm line 581 (#1) (F) Only hard references are allowed by "strict refs". Symbolic references are disallowed. See perlref. #### my $command = "my \@returnstring = \$d->checklist( text => $text, list => [ @list ] );"; #### my @returnstring = $d->checklist( text => Text, list => [ '1' , [ 'item1' , 0 ] , '2' , [ 'item2' , 0 ] , '3' , [ 'item3' , 0 ] , '4' , [ 'item4' , 0 ] , '5' , [ 'item5' , 0 ] , '6' , [ 'item6' , 0 ] ] );