Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re: Setting value in Tk -textvariable

by Chmrr (Vicar)
on Aug 06, 2002 at 01:18 UTC ( #187879=note: print w/replies, xml ) Need Help??

in reply to Setting value in Tk -textvariable

Tk's not the one complaining at you; perl is complaining that you're not doing what you think you're doing. If it's saying that it can't use a string as a hash reference, that means that $move isn't a hash reference, it's a string. Somewhere along the ways, you've gotten confused as to what's in what variable. I'd suggest a proper application of Data::Dumper to the variables in question to figure out what's going on.

Here's a crude and fast example of setting a label's value to something in a hash reference:

use Tk; my $main = tkinit; my $value = "Foo!"; my $href = {bar=>baz}; $main->Label(-textvariable=>\$value)->pack; $main->after(5000,sub{$value=$$href{bar}; $main->update;}); $main->MainLoop();

perl -pe '"I lo*`+$^X$\"$]!$/"=~m%(.*)%s;$_=$1;y^`+*^e v^#$&V"+@( NO CARRIER'

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://187879]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2017-11-21 07:08 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (296 votes). Check out past polls.