tags:

views:

51

answers:

1
+2  A: 

Where does $heap in &validate come from? You don't pass it as a parameter. Could $heap in &validate and $heap in &in_button_1_press not be the same thing? Have you tried printing the stringy form of $heap to see if the addresses are the same in the two functions?

Andrew Barnett
Some missing code;use Tk;use POE qw( Loop::TkActiveState );From perldoc POE::Session;POE::Session's Calling Convention sub handle_event { my ($kernel, $heap, $parameter) = @_[KERNEL, HEAP, ARG0]; ...; }Or the use of C"$_[KERNEL]", C"$_[HEAP]" and C"$_[ARG0]" inline, as is done in most examples.What's going on here is rather basic. Perl passes parameters into subroutines or methods using the @_ array. "KERNEL", "HEAP", "ARG0" and others are constants exported by POE::Session (which is included for free when a program uses POE)."stringy form of $heap"?
jpolache
Andrew Barnett
Whoops. This doesn't look right (in validate): my $heap->{ih_mw} ...Try that without the 'my', and see if it works better.
Andrew Barnett
Andrew, if you will post that as an answer, I will be glad to check and upvote it ;). Many thanks. - Jon
jpolache
Oh, that was an answer. OK, got it, thanks again.
jpolache
From perlsub (1): # Makes current @_ visible to called subroutine.
Inshallah
Doh! I knew it was something like that. Thanks Inshalla.
Andrew Barnett