Scarborough has asked for the wisdom of the Perl Monks concerning the following question:

In Tk I have this command

my $get_button = $mw->Button(-text=>'Get Parameters', -command=>[\ +&get_params, \$job_name])->pack;

This works fine but &get_params returns an array, where does the array end up or can't I do this.

I may be missing something here.

Replies are listed 'Best First'.
Re: Tk returns from a sub
by matija (Priest) on Sep 13, 2004 at 14:45 UTC
    command will call &get_params in a void context. That means the array it returns will end up in the great write-only bitbucket in the sky.

    Yes, you can do that, no damage done - unless you need the contents of that array. In that case, you will need to make other arrangements.

      I think thats where I go in my nightmares - the great write-only bitbucket in the sky.

      I've now changed things to take an extra parameter a ref to an array and load that up in the sub. Thanks for your help.