1752781 Members
6325 Online
108789 Solutions
New Discussion юеВ

Re: Perl question

 
SOLVED
Go to solution
Alexander Chuzhoy
Honored Contributor

Re: Perl question

Hey,Mark.Your last advice seems nice-although I can't make it work.


Here's a sample:
$a=$mw->Checkbutton('-indicator'=>off,'-activebackground'=>green,'-border'=>15,'-text'=>green,-command=>sub {&action,$a},'-variable'=>\$buta)->place(-x=>10,-y=>10,-height=>40,-width=>40);



sub action {
destroy $_[0];
}
I guess the sintax isn't correct.But what exactly?

Mark Grant
Honored Contributor

Re: Perl question

I don't think you'll get away with an anonymous function in this case. You'll need an "action" function and pass parameters to it as an array as in "-command => [ \&action,$a ]"

Then you need your destroy in the "action" subroutine.
Never preceed any demonstration with anything more predictive than "watch this"
Sheldon Plankton
New Member

Re: Perl question

You could always ask the perlmonks.
http://www.perlmonks.org