handling -command return values 
Author Message
 handling -command return values

Please help: When calling subroutines normally, you can type:
    $return_value = subroutine(args);
or whatever, to get hold of the return value from the sub, for
processing.
However, I don't see how to handle the return values when calling a
subroutine using the -command option on a button (or other widget).

The answer to this is probably blindingly obvious to someone out there,
but I am a novice Perl/Tk user, so i know nooooooothing.

HOW??? how how how? (any help much appreciated)

Gen ;)

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Sun, 07 Jul 2002 03:00:00 GMT  
 handling -command return values

Quote:
> However, I don't see how to handle the return values when calling a
> subroutine using the -command option on a button (or other widget).

One possible solution is to pass a reference to a varaible as the parameter
to the subroutine, and have the subroutine update the reference. Somethink
like....

-command => [\&my_subroutine, \$value_ref]

HTH
-Partha



Mon, 08 Jul 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Flexible sub param/return value handling?

2. Return value from backtick command needs to be 32-bit signed

3. PERLFUNC: values - return a list of the values in a hash

4. PERLFUNC: values - return a list of the values in a hash

5. Problem returning file handles from sub

6. Handling return codes over 256

7. Open file in sub, return local handle ?

8. DBI Proxy: Constructor didn't return a handle

9. Returning file handles from XSUBs

10. Object in @INC returning Tie::Handles from INC method

11. Returning file handle from a subroutine

12. DBI Proxy: Constructor didn't return a handle

 

 
Powered by phpBB® Forum Software