It isn't really working. Tk::Error AUTOLOAD 'Tk::Toplevel::destory' at line 97 happend because you said ->destory when you meant ->destroy - and your window fgoes away because your program died.
To make the subroutine work, I think the part you're missing is this:
doit('here is my input', 'some more'); sub doit { my ( $in1, $in2 ) = @_; print "$in1\n"; print "$in2\n"; }
subs all receive their parameters in @_ - then you transfer them in to local variables for readability, isolation, etc.
In the orginal form of my example the line my $thiswin = $_[0]; in the close_win sub did this, just getting the first (and only) elment of @_;--Bob Niederman, http://bob-n.com
All code given here is UNTESTED unless otherwise stated.
In reply to Re: Re: Re: Functions and Tk
by bobn
in thread Functions and Tk
by surrealistfashion
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |